diff options
author | Philip Schuchardt <vpicaver@gmail.com> | 2023-11-29 18:27:39 -0600 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-01-16 20:59:45 +0000 |
commit | dbc230139f627558c583f5d1dccba4ac2b9a812b (patch) | |
tree | 710cefa9056f7cbba5d83a5db2484b297654bf1e | |
parent | 4c960739e0a27d3585c846c1ef5c9be9ebb38c14 (diff) |
Enable uniform buffer for RHI compute shaders
This enables uniform buffers for all rendering stages
including the compute stage.
[ChangeLog] Enable uniform buffer for RHI compute shaders
Fixes: QTBUG-119659
Change-Id: I7c83bc9bf33cef4b925b52b7f4d6cde79e7e62e3
Reviewed-by: Mike Krus <mike.krus@kdab.com>
(cherry picked from commit 7dd1fe963d1b27d880f302ccd09e5b71447bd899)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 51cfb893c59c41064c8b09e1172f7b311dba8030)
-rw-r--r-- | src/plugins/renderers/rhi/renderer/pipelineuboset.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/renderers/rhi/renderer/pipelineuboset.cpp b/src/plugins/renderers/rhi/renderer/pipelineuboset.cpp index b9c09125d..8cffaac4f 100644 --- a/src/plugins/renderers/rhi/renderer/pipelineuboset.cpp +++ b/src/plugins/renderers/rhi/renderer/pipelineuboset.cpp @@ -243,7 +243,7 @@ std::vector<QRhiShaderResourceBinding> PipelineUBOSet::resourceBindings(const Re { RHITextureManager *textureManager = m_resourceManagers->rhiTextureManager(); RHIShader *shader = command.m_rhiShader; - const QRhiShaderResourceBinding::StageFlags stages = QRhiShaderResourceBinding::VertexStage|QRhiShaderResourceBinding::FragmentStage; + const QRhiShaderResourceBinding::StageFlags stages = QRhiShaderResourceBinding::ComputeStage|QRhiShaderResourceBinding::VertexStage|QRhiShaderResourceBinding::FragmentStage; std::vector<QRhiShaderResourceBinding> bindings = { QRhiShaderResourceBinding::uniformBuffer(0, stages, m_rvUBO.buffer->rhiBuffer()), }; @@ -323,9 +323,10 @@ std::vector<QRhiShaderResourceBinding> PipelineUBOSet::resourceBindings(const Re for (const BlockToSSBO &ssbo : command.m_parameterPack.shaderStorageBuffers()) { RHIBuffer *buffer = m_resourceManagers->rhiBufferManager()->lookupResource(ssbo.m_bufferID); if (buffer) { + Q_ASSERT(stages & QRhiShaderResourceBinding::ComputeStage); bindings.push_back(QRhiShaderResourceBinding::bufferLoadStore( ssbo.m_bindingIndex, - stages|QRhiShaderResourceBinding::ComputeStage, + stages, buffer->rhiBuffer())); } } |