diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2020-08-27 11:07:31 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-08-27 10:40:16 +0000 |
commit | 0ce9fba0775ce82a0deecc68f3b9febdc57983e5 (patch) | |
tree | be9aaac0e7e1d4918650a5e56aace9ca02e86b11 /src | |
parent | 09eb4028e1221a8aaca8b563a1dba2ae6c39b92c (diff) |
opengl: add envlight texture alias to texture unit check
Since those uniforms are injected by Qt3D, them not being used by a shader
is valid and shouldn't result in the function return false. This could
otherwise prevent valid draw calls from being made
Change-Id: I562cc40d758a174bf9d315a9ab0919ae55a0b04f
Reviewed-by: Mike Krus <mike.krus@kdab.com>
(cherry picked from commit f9920b285767bceb7b771df000742c277ac9da91)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp index cdd1cfeef..3ca0d6191 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp +++ b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp @@ -1186,8 +1186,10 @@ void SubmissionContext::setUpdatedTexture(const Qt3DCore::QNodeIdVector &updated // than the other way around bool SubmissionContext::setParameters(ShaderParameterPack ¶meterPack, GLShader *shader) { - static const int irradianceId = StringToInt::lookupId(QLatin1String("envLight.irradiance")); - static const int specularId = StringToInt::lookupId(QLatin1String("envLight.specular")); + static const int irradianceStructId = StringToInt::lookupId(QLatin1String("envLight.irradiance")); + static const int specularStructId = StringToInt::lookupId(QLatin1String("envLight.specular")); + static const int irradianceId = StringToInt::lookupId(QLatin1String("envLightIrradiance")); + static const int specularId = StringToInt::lookupId(QLatin1String("envLightSpecular")); // Activate textures and update TextureUniform in the pack // with the correct textureUnit @@ -1211,9 +1213,11 @@ bool SubmissionContext::setParameters(ShaderParameterPack ¶meterPack, GLShad texUniform.data<int>()[namedTex.uniformArrayIndex] = texUnit; if (texUnit == -1) { if (namedTex.glslNameId != irradianceId && - namedTex.glslNameId != specularId) { + namedTex.glslNameId != specularId && + namedTex.glslNameId != irradianceStructId && + namedTex.glslNameId != specularStructId) { // Only return false if we are not dealing with env light textures - qCWarning(Backend) << "Unable to find suitable Texture Unit"; + qCWarning(Backend) << "Unable to find suitable Texture Unit for" << StringToInt::lookupString(namedTex.glslNameId); return false; } } |