From 47e78d0a9553d7608f912eff2a583af5b7bef2de Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 30 Mar 2018 17:31:48 +0200 Subject: [PATCH] [dxbc] Fixed type of atomic pointers into typed UAVs Should fix a crash in the Nvidia driver. --- src/dxbc/dxbc_compiler.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index ef328e2fb..b412c4358 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -1989,8 +1989,9 @@ namespace dxvk { std::array src; for (uint32_t i = 1; i < ins.srcCount; i++) { - src[i - 1] = emitRegisterLoad(ins.src[i], - DxbcRegMask(true, false, false, false)); + src[i - 1] = emitRegisterBitcast( + emitRegisterLoad(ins.src[i], DxbcRegMask(true, false, false, false)), + pointer.type.ctype); } // Define memory scope and semantics based on the operands @@ -2007,9 +2008,8 @@ namespace dxvk { // Perform the atomic operation on the given pointer DxbcRegisterValue value; - value.type.ctype = ins.dst[0].dataType; - value.type.ccount = 1; - value.id = 0; + value.type = pointer.type; + value.id = 0; // The result type, which is a scalar integer const uint32_t typeId = getVectorTypeId(value.type); @@ -4286,7 +4286,7 @@ namespace dxvk { // Compute the actual pointer DxbcRegisterPointer result; - result.type.ctype = operand.dataType; + result.type.ctype = resourceInfo.stype; result.type.ccount = 1; result.id = isUav ? m_module.opImageTexelPointer(