From 00494ec3b5629464cbc5677cc5440541350d49c5 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sun, 18 Jul 2021 13:38:10 -0300 Subject: [PATCH] Error if image load/store is used since it's not supported yet. --- src/modules/graphics/Shader.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/modules/graphics/Shader.cpp b/src/modules/graphics/Shader.cpp index b71bf40ce..c2cd06c24 100644 --- a/src/modules/graphics/Shader.cpp +++ b/src/modules/graphics/Shader.cpp @@ -734,6 +734,22 @@ bool Shader::validateInternal(StrongRef stages[], std::string &err, } } + for (int i = 0; i < program.getNumUniformVariables(); i++) + { + const glslang::TObjectReflection &info = program.getUniform(i); + const glslang::TType *type = info.getType(); + if (type == nullptr) + continue; + + if (type->isImage()) + { + // TODO: Change this check to only error if a writable image is + // declared in non-compute, once support is added for them. + err = "Shader validation error:\nImage load/store (image2D uniforms, etc.) is not supported yet."; + return false; + } + } + for (int i = 0; i < program.getNumBufferBlocks(); i++) { const glslang::TObjectReflection &info = program.getBufferBlock(i);