summaryrefslogtreecommitdiffstats
path: root/src/plugins/renderers/opengl/renderer/renderview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/renderers/opengl/renderer/renderview.cpp')
-rw-r--r--src/plugins/renderers/opengl/renderer/renderview.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/renderers/opengl/renderer/renderview.cpp b/src/plugins/renderers/opengl/renderer/renderview.cpp
index 8c2d5a39d..007fb07e0 100644
--- a/src/plugins/renderers/opengl/renderer/renderview.cpp
+++ b/src/plugins/renderers/opengl/renderer/renderview.cpp
@@ -1080,6 +1080,7 @@ void RenderView::setShaderAndUniforms(RenderCommand *command,
command->m_parameterPack.reserve(shader->parameterPackSize());
}
+ const size_t previousUniformCount = command->m_parameterPack.uniforms().size();
if (shader->hasActiveVariables()) {
const QVector<int> &standardUniformNamesIds = shader->standardUniformNameIds();
@@ -1104,8 +1105,9 @@ void RenderView::setShaderAndUniforms(RenderCommand *command,
updateLightUniforms(command, entity);
}
+ const size_t actualUniformCount = command->m_parameterPack.uniforms().size();
// Prepare the ShaderParameterPack based on the active uniforms of the shader
- if (!updateUniformsOnly)
+ if (!updateUniformsOnly || previousUniformCount != actualUniformCount)
shader->prepareUniforms(command->m_parameterPack);
}