summaryrefslogtreecommitdiffstats
path: root/src/gui/rhi/qrhid3d11.cpp
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.cpp
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.cpp')
-rw-r--r--src/gui/rhi/qrhid3d11.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp
index 49e90693be..eea2a13d8c 100644
--- a/src/gui/rhi/qrhid3d11.cpp
+++ b/src/gui/rhi/qrhid3d11.cpp
@@ -1480,6 +1480,8 @@ void QRhiD3D11::beginPass(QRhiCommandBuffer *cb,
cbD->recordingPass = QD3D11CommandBuffer::RenderPass;
cbD->currentTarget = rt;
+
+ cbD->resetCachedShaderResourceState();
}
void QRhiD3D11::endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
@@ -1556,6 +1558,8 @@ void QRhiD3D11::beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch
cbD->commands.append(cmd);
cbD->recordingPass = QD3D11CommandBuffer::ComputePass;
+
+ cbD->resetCachedShaderResourceState();
}
void QRhiD3D11::endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)