From a9e36efa183ffd8a0ea95242305a35aaefad9dfe Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 16 Sep 2016 13:47:19 +0200 Subject: [PATCH] Unwrap different types of barriers properly --- .../driver/d3d12/d3d12_command_list_wrap.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp index e9be5a742..0ff8a63ce 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp @@ -889,11 +889,20 @@ void WrappedID3D12GraphicsCommandList::ResourceBarrier(UINT NumBarriers, for(UINT i = 0; i < NumBarriers; i++) { barriers[i] = pBarriers[i]; - barriers[i].Transition.pResource = Unwrap(barriers[i].Transition.pResource); - // hack while not all resources are wrapped - if(barriers[i].Transition.pResource == NULL) - barriers[i].Transition.pResource = pBarriers[i].Transition.pResource; + if(barriers[i].Type == D3D12_RESOURCE_BARRIER_TYPE_TRANSITION) + { + barriers[i].Transition.pResource = Unwrap(barriers[i].Transition.pResource); + } + else if(barriers[i].Type == D3D12_RESOURCE_BARRIER_TYPE_ALIASING) + { + barriers[i].Aliasing.pResourceBefore = Unwrap(barriers[i].Aliasing.pResourceBefore); + barriers[i].Aliasing.pResourceAfter = Unwrap(barriers[i].Aliasing.pResourceAfter); + } + else if(barriers[i].Type == D3D12_RESOURCE_BARRIER_TYPE_UAV) + { + barriers[i].UAV.pResource = Unwrap(barriers[i].UAV.pResource); + } } m_pReal->ResourceBarrier(NumBarriers, barriers);