From b916c0ad92645474b0eb6a6e976f6acc161b1ab3 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sat, 6 Nov 2021 10:41:30 -0300 Subject: [PATCH] Fix error message when sending buffers to unused variables --- src/modules/graphics/opengl/Shader.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/modules/graphics/opengl/Shader.cpp b/src/modules/graphics/opengl/Shader.cpp index 7abd4e2d1..9bacf446e 100644 --- a/src/modules/graphics/opengl/Shader.cpp +++ b/src/modules/graphics/opengl/Shader.cpp @@ -166,6 +166,12 @@ void Shader::mapActiveUniforms() u.storageTextureFormat = reflectionit->second.format; u.access = reflectionit->second.access; } + else + { + // No reflection info - maybe glslang was better at detecting + // dead code than the driver's compiler? + continue; + } StorageTextureBinding binding = {}; binding.gltexture = gl.getDefaultTexture(u.textureType, u.dataBaseType); @@ -372,6 +378,12 @@ void Shader::mapActiveUniforms() u.bufferMemberCount = reflectionit->second.memberCount; u.access = reflectionit->second.access; } + else + { + // No reflection info - maybe glslang was better at detecting + // dead code than the driver's compiler? + continue; + } // Make sure previously set uniform data is preserved, and shader- // initialized values are retrieved.