From f74a119e0513b66a74f7af7f28d2721d0e66a14e Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 18 Jun 2024 16:45:48 +0100 Subject: [PATCH] Remap addresses to live in indirect dispatch on replay --- renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp | 1 - renderdoc/driver/d3d12/d3d12_debug.cpp | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp index 837dcfd18..2935ae38c 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp @@ -1491,7 +1491,6 @@ bool WrappedID3D12GraphicsCommandList::Serialise_DispatchRays(SerialiserType &se m_Cmd->m_RayDispatches.push_back(patchedDispatch.resources); uint32_t eventId = m_Cmd->HandlePreCallback(list, ActionFlags::DispatchRay); - // this can't work yet as the shader records have not been patched Unwrap4(list)->DispatchRays(&patchedDispatch.desc); if(eventId && m_Cmd->m_ActionCallback->PostDraw(eventId, list)) { diff --git a/renderdoc/driver/d3d12/d3d12_debug.cpp b/renderdoc/driver/d3d12/d3d12_debug.cpp index 9395636ab..24f123b07 100644 --- a/renderdoc/driver/d3d12/d3d12_debug.cpp +++ b/renderdoc/driver/d3d12/d3d12_debug.cpp @@ -1043,6 +1043,13 @@ rdcpair D3D12DebugManager::PatchExecuteIndirect( } case D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_RAYS: { + argOffsets.push_back( + offset + offsetof(D3D12_DISPATCH_RAYS_DESC, RayGenerationShaderRecord.StartAddress)); + argOffsets.push_back(offset + + offsetof(D3D12_DISPATCH_RAYS_DESC, MissShaderTable.StartAddress)); + argOffsets.push_back(offset + offsetof(D3D12_DISPATCH_RAYS_DESC, HitGroupTable.StartAddress)); + argOffsets.push_back(offset + + offsetof(D3D12_DISPATCH_RAYS_DESC, CallableShaderTable.StartAddress)); offset += sizeof(D3D12_DISPATCH_RAYS_DESC); break; }