From 5ae5053a2aa60bb0818080c0c6cdeb6f9e3ed7e1 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 26 Aug 2019 16:56:07 +0200 Subject: [PATCH] [d3d11] Remove templated SetUnorderedAccessViews Not needed because the CS and OM paths are separate anyway. --- src/d3d11/d3d11_context.cpp | 45 +++++++++++++------------------------ src/d3d11/d3d11_context.h | 8 ------- 2 files changed, 15 insertions(+), 38 deletions(-) diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index e204eb5e..a58832f0 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -2469,11 +2469,21 @@ namespace dxvk { const UINT* pUAVInitialCounts) { D3D10DeviceLock lock = LockContext(); - SetUnorderedAccessViews( - m_state.cs.unorderedAccessViews, - StartSlot, NumUAVs, - ppUnorderedAccessViews, - pUAVInitialCounts); + uint32_t uavSlotId = computeUavBinding (DxbcProgramType::ComputeShader, StartSlot); + uint32_t ctrSlotId = computeUavCounterBinding(DxbcProgramType::ComputeShader, StartSlot); + + for (uint32_t i = 0; i < NumUAVs; i++) { + auto uav = static_cast(ppUnorderedAccessViews[i]); + auto ctr = pUAVInitialCounts ? pUAVInitialCounts[i] : ~0u; + + if (m_state.cs.unorderedAccessViews[StartSlot + i] != uav || ctr != ~0u) { + m_state.cs.unorderedAccessViews[StartSlot + i] = uav; + + BindUnorderedAccessView( + uavSlotId + i, uav, + ctrSlotId + i, ctr); + } + } } @@ -3522,31 +3532,6 @@ namespace dxvk { } - template - void D3D11DeviceContext::SetUnorderedAccessViews( - D3D11UnorderedAccessBindings& Bindings, - UINT StartSlot, - UINT NumUAVs, - ID3D11UnorderedAccessView* const* ppUnorderedAccessViews, - const UINT* pUAVInitialCounts) { - uint32_t uavSlotId = computeUavBinding (ShaderStage, StartSlot); - uint32_t ctrSlotId = computeUavCounterBinding(ShaderStage, StartSlot); - - for (uint32_t i = 0; i < NumUAVs; i++) { - auto uav = static_cast(ppUnorderedAccessViews[i]); - auto ctr = pUAVInitialCounts ? pUAVInitialCounts[i] : ~0u; - - if (Bindings[StartSlot + i] != uav || ctr != ~0u) { - Bindings[StartSlot + i] = uav; - - BindUnorderedAccessView( - uavSlotId + i, uav, - ctrSlotId + i, ctr); - } - } - } - - void D3D11DeviceContext::GetConstantBuffers( const D3D11ConstantBufferBindings& Bindings, UINT StartSlot, diff --git a/src/d3d11/d3d11_context.h b/src/d3d11/d3d11_context.h index 5835a125..81efeb76 100644 --- a/src/d3d11/d3d11_context.h +++ b/src/d3d11/d3d11_context.h @@ -770,14 +770,6 @@ namespace dxvk { UINT NumResources, ID3D11ShaderResourceView* const* ppResources); - template - void SetUnorderedAccessViews( - D3D11UnorderedAccessBindings& Bindings, - UINT StartSlot, - UINT NumUAVs, - ID3D11UnorderedAccessView* const* ppUnorderedAccessViews, - const UINT* pUAVInitialCounts); - void GetConstantBuffers( const D3D11ConstantBufferBindings& Bindings, UINT StartSlot,