summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2022-05-09 19:25:39 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2022-05-10 15:51:04 +0200
commit2d3894f3565a13bc62ad8c1e1b0434e811e71efc (patch)
tree1e066e42401e2317eadcddc4ae898eef826e6fe2 /src
parenta1903eb94121e5cff29b70ee0f59044bdc7d5980 (diff)
rhi: d3d: Fix not resetting the pipeline tracking between passes
Do what all other backends do. If we did not want to reset the pipeline tracking pointer, then more logic would be needed, in order not to end up in trouble with clients that do: loop: create a pipeline // [1] beginpass ... // use the pipeline endpass readback finish destroy the pipeline goto loop ...because we may get the exact same pipeline pointer (with a matching generation even since it's always 1 in this case) in the different passes, just because malloc decided to do so in [1]. This could be solved by checking the global resource id but won't do that now as no other backends do it either. This solves random broken rendering with the Qt Quick 3D lightmapper. The above outline is exactly what the UV rasterization stage does. Pick-to: 6.3 6.2 Change-Id: Id74a0a336634d99092181b09dd7137eaec355d48 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/gui/rhi/qrhid3d11.cpp4
-rw-r--r--src/gui/rhi/qrhid3d11_p_p.h3
2 files changed, 2 insertions, 5 deletions
diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp
index 06ce55c52a..865b7b313d 100644
--- a/src/gui/rhi/qrhid3d11.cpp
+++ b/src/gui/rhi/qrhid3d11.cpp
@@ -1842,7 +1842,7 @@ void QRhiD3D11::beginPass(QRhiCommandBuffer *cb,
cbD->recordingPass = QD3D11CommandBuffer::RenderPass;
cbD->currentTarget = rt;
- cbD->resetCachedShaderResourceState();
+ cbD->resetCachedState();
}
void QRhiD3D11::endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
@@ -1928,7 +1928,7 @@ void QRhiD3D11::beginComputePass(QRhiCommandBuffer *cb,
cbD->recordingPass = QD3D11CommandBuffer::ComputePass;
- cbD->resetCachedShaderResourceState();
+ cbD->resetCachedState();
}
void QRhiD3D11::endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
diff --git a/src/gui/rhi/qrhid3d11_p_p.h b/src/gui/rhi/qrhid3d11_p_p.h
index 76a40ebce6..200ac5aa14 100644
--- a/src/gui/rhi/qrhid3d11_p_p.h
+++ b/src/gui/rhi/qrhid3d11_p_p.h
@@ -535,9 +535,6 @@ struct QD3D11CommandBuffer : public QRhiCommandBuffer
currentGraphicsPipeline = nullptr;
currentComputePipeline = nullptr;
currentPipelineGeneration = 0;
- resetCachedShaderResourceState();
- }
- void resetCachedShaderResourceState() {
currentGraphicsSrb = nullptr;
currentComputeSrb = nullptr;
currentSrbGeneration = 0;