diff --git a/renderdoc/driver/d3d12/d3d12_debug.cpp b/renderdoc/driver/d3d12/d3d12_debug.cpp index e3799c21c..2cfb45225 100644 --- a/renderdoc/driver/d3d12/d3d12_debug.cpp +++ b/renderdoc/driver/d3d12/d3d12_debug.cpp @@ -1680,6 +1680,10 @@ void D3D12DebugManager::FillWithDiscardPattern(ID3D12GraphicsCommandListX *cmd, b.Transition.StateAfter = D3D12_RESOURCE_STATE_COPY_DEST; + // Special case for D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS + if(desc.Flags & D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS) + b.Transition.StateBefore = D3D12_RESOURCE_STATE_COMMON; + D3D12_TEXTURE_BARRIER tex = {}; D3D12_BARRIER_GROUP group = {}; @@ -1695,6 +1699,10 @@ void D3D12DebugManager::FillWithDiscardPattern(ID3D12GraphicsCommandListX *cmd, tex.AccessAfter = D3D12_BARRIER_ACCESS_COPY_DEST; tex.SyncAfter = D3D12_BARRIER_SYNC_COPY; + // Special case for D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS + if(desc.Flags & D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS) + tex.LayoutAfter = D3D12_BARRIER_LAYOUT_COMMON; + tex.Flags = D3D12_TEXTURE_BARRIER_FLAG_DISCARD; tex.Subresources.IndexOrFirstMipLevel = (UINT)sub; tex.pResource = res; @@ -1792,6 +1800,10 @@ void D3D12DebugManager::FillWithDiscardPattern(ID3D12GraphicsCommandListX *cmd, tex.LayoutAfter = D3D12_BARRIER_LAYOUT_COMMON; } + // Special case for D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS + if(desc.Flags & D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS) + tex.LayoutBefore = D3D12_BARRIER_LAYOUT_COMMON; + cmd->Barrier(1, &group); } else