diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2022-05-09 19:25:39 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2022-05-10 15:51:04 +0200 |
commit | 2d3894f3565a13bc62ad8c1e1b0434e811e71efc (patch) | |
tree | 1e066e42401e2317eadcddc4ae898eef826e6fe2 /src/gui/rhi/qrhid3d11.cpp | |
parent | a1903eb94121e5cff29b70ee0f59044bdc7d5980 (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/gui/rhi/qrhid3d11.cpp')
-rw-r--r-- | src/gui/rhi/qrhid3d11.cpp | 4 |
1 files changed, 2 insertions, 2 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) |