Browse Source

Fix error message when sending buffers to unused variables

Alex Szpakowski 3 years ago
parent
commit
b916c0ad92
1 changed files with 12 additions and 0 deletions
  1. 12 0
      src/modules/graphics/opengl/Shader.cpp

+ 12 - 0
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.