summaryrefslogtreecommitdiffstats
path: root/src/gui/rhi/qrhid3d11_p_p.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2019-06-28 15:55:52 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2019-07-01 17:34:51 +0200
commit2c289c6c1e04c419eefb890f19872a5bddc2fe78 (patch)
tree5bc219a96c59c8b0ece9802b7356c7ea6a4e6dec /src/gui/rhi/qrhid3d11_p_p.h
parent058c52fc2a6476f688d4b07d6f24516e26d0a8f5 (diff)
rhi: d3d: Fix resource binding mismatch with multiple passes
The resetShaderResources() done when starting a render or compute pass purges all vertex, index, SRV, and UAV bindings. This will be optimized at a later point, but until then the command buffer's state should be updated accordingly, otherwise certain use cases end up with incorrect rendering results due to not binding vertex/index/shader resources as appropriate. This fixes the shadowmap example on d3d. Change-Id: I4d07929b8664b64bc608c6c8df474b0ee7c2ddbb Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhid3d11_p_p.h')
-rw-r--r--src/gui/rhi/qrhid3d11_p_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhid3d11_p_p.h b/src/gui/rhi/qrhid3d11_p_p.h
index 688f79b3b7..34c9ff70f8 100644
--- a/src/gui/rhi/qrhid3d11_p_p.h
+++ b/src/gui/rhi/qrhid3d11_p_p.h
@@ -482,6 +482,9 @@ struct QD3D11CommandBuffer : public QRhiCommandBuffer
currentGraphicsPipeline = nullptr;
currentComputePipeline = nullptr;
currentPipelineGeneration = 0;
+ resetCachedShaderResourceState();
+ }
+ void resetCachedShaderResourceState() {
currentGraphicsSrb = nullptr;
currentComputeSrb = nullptr;
currentSrbGeneration = 0;