Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/doitsujin/dxvk.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDean Beeler <canadacow@gmail.com>2024-01-23 18:01:12 +0300
committerGitHub <noreply@github.com>2024-01-23 18:01:12 +0300
commitd4c5fc74e7b749f460d9bd91dea8b8d0091c7507 (patch)
treee87237c2eb375f4706f2770338305c0ae054b807
parent6199776869308b6d8f38095a580bda8ca711fd71 (diff)
d3d11: Fix crash when srv is submitted to ClearUnorderedAccessViewUintHEADmaster
* The Settlers submits (possibly incorrectly) an SRV to ClearUnorderedAccessViewUint. The static_cast in the function does not translate correctly and crashes. Native D3D11 behavior is to ignore the bad parameter entirely. It does not clear the SRV nor does it fault or even error with the DEBUG validator.
-rw-r--r--src/d3d11/d3d11_context.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp
index 977a403e..4b06ae38 100644
--- a/src/d3d11/d3d11_context.cpp
+++ b/src/d3d11/d3d11_context.cpp
@@ -386,11 +386,16 @@ namespace dxvk {
const UINT Values[4]) {
D3D10DeviceLock lock = LockContext();
- auto uav = static_cast<D3D11UnorderedAccessView*>(pUnorderedAccessView);
+ if (!pUnorderedAccessView)
+ return;
- if (!uav)
+ Com<ID3D11UnorderedAccessView> qiUav;
+
+ if (FAILED(pUnorderedAccessView->QueryInterface(IID_PPV_ARGS(&qiUav))))
return;
+ auto uav = static_cast<D3D11UnorderedAccessView*>(qiUav.ptr());
+
// Gather UAV format info. We'll use this to determine
// whether we need to create a temporary view or not.
D3D11_UNORDERED_ACCESS_VIEW_DESC uavDesc;