From 204f003f2b7719eedd1497efdda492cfc90f8cf0 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 11 Feb 2025 14:06:01 +0000 Subject: [PATCH] Ensure safe state is used for RT builds on compute command buffers --- renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp index 559751034..43f167304 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp @@ -792,6 +792,7 @@ bool WrappedID3D12GraphicsCommandList::PatchAccStructBlasAddress( // Here, we are uploading the old BLAS addresses, and comparing the BLAS // addresses in the TLAS and patching it with the corresponding new address. + BakedCmdListInfo &bakedCmdInfo = m_Cmd->m_BakedCmdListInfo[m_Cmd->m_LastCmdListID]; D3D12RTManager *rtManager = GetResourceManager()->GetRTManager(); // Create a resource for patched instance desc; we don't @@ -825,6 +826,9 @@ bool WrappedID3D12GraphicsCommandList::PatchAccStructBlasAddress( { needInitialTransition = true; } + + if(bakedCmdInfo.type == D3D12_COMMAND_LIST_TYPE_COMPUTE) + instanceResState = D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE; } {