summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOle Wegen <olewegen@gmx.de>2022-10-21 09:28:02 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-11-17 20:23:45 +0000
commit3eea81e864f97d6ecbbfc945a53bf690424e4315 (patch)
treec329c0ea96e13a07eef630a29a17d674e2e9d87d
parenta210560e9a39da9dbc6eb347ec5ab590e39f5b72 (diff)
downloadqt3d-3eea81e864f97d6ecbbfc945a53bf690424e4315.tar.gz
Unpin previously used image units during render command parameter setup
Image units are not unpinned after executing a render/compute command and before executing the next one. This can lead to failure during binding of textures to image units if the number of required image units of subsequent commands exceeds the overall number of image units. Therefore, the image units are now unpinned during parameter setup of each command. Change-Id: I9ae7be0bf8c2efe33aca836ef9e81db7c8f5b654 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit 51aa6ab005e86c6a1c5d4c91671bd8c68dde0dea) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp
index c3c735a98..833fac7b6 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp
+++ b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp
@@ -1226,6 +1226,10 @@ bool SubmissionContext::setParameters(ShaderParameterPack &parameterPack, GLShad
}
}
+ // Set the pinned images of the previous material
+ // to pinable so that we should easily find an available image unit
+ m_imageContext.deactivateImages();
+
// Fill Image Uniform Value with proper image units
// so that they can be applied as regular uniforms in a second step
for (size_t i = 0; i < parameterPack.images().size(); ++i) {