diff options
author | Mike Krus <mike.krus@kdab.com> | 2019-01-16 14:26:21 +0000 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2019-01-18 16:22:23 +0000 |
commit | 382f99cb4b399118bd64115e5a143da098b5f234 (patch) | |
tree | b4694cfbf67ef8ef4832290cfa22cd5c4e45d0ed | |
parent | 093484cd41e0b727e4f2a33bd753a778e62af819 (diff) |
Fix issue with invalid textures
Previous fix for missing env map triggers some corner cases
Change-Id: Icfa5657973b4050fed0681bb929091e7659012fc
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r-- | src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp b/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp index d9077976c..dc1e85b8e 100644 --- a/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp +++ b/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp @@ -1273,14 +1273,15 @@ bool SubmissionContext::setParameters(ShaderParameterPack ¶meterPack) GLTexture *t = manager->glTextureManager()->lookupResource(namedTex.texId); if (t != nullptr) { UniformValue &texUniform = uniformValues[namedTex.glslNameId]; - Q_ASSERT(texUniform.valueType() == UniformValue::TextureValue); - const int texUnit = activateTexture(TextureScopeMaterial, t); - texUniform.data<int>()[namedTex.uniformArrayIndex] = texUnit; - if (texUnit == -1) { - if (namedTex.glslNameId != irradianceId && - namedTex.glslNameId != specularId) { - // Only return false if we are not dealing with env light textures - return false; + if (texUniform.valueType() == UniformValue::TextureValue) { + const int texUnit = activateTexture(TextureScopeMaterial, t); + texUniform.data<int>()[namedTex.uniformArrayIndex] = texUnit; + if (texUnit == -1) { + if (namedTex.glslNameId != irradianceId && + namedTex.glslNameId != specularId) { + // Only return false if we are not dealing with env light textures + return false; + } } } } |