From 13b6d9a854e1e057dd411900fa125fc3e314983d Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 5 May 2026 15:58:36 +0100 Subject: [PATCH] Use chunk offset not relative EID for AS patchbuffer lookup * EIDs can change after initial recording of a command buffer, due to resizing indirect executes, causing loading and active replaying to disagree on the relative EID of a build. Chunk offsets are always fixed and we only need a unique incrementing counter. --- renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp index c9b9f0f21..53ddd49a9 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp @@ -1006,17 +1006,18 @@ bool WrappedID3D12GraphicsCommandList::Serialise_BuildRaytracingAccelerationStru m_Cmd->m_LastCmdListID = GetResID(pCommandList); BakedCmdListInfo &bakedCmdInfo = m_Cmd->m_BakedCmdListInfo[m_Cmd->m_LastCmdListID]; BakedCmdListInfo::PatchRaytracing &patchInfo = - bakedCmdInfo.m_patchRaytracingInfo[bakedCmdInfo.curEventID]; + bakedCmdInfo.m_patchRaytracingInfo[m_Cmd->m_CurChunkOffset & 0xffffffff]; D3D12AccelerationStructure *accStructAtDstOffset = NULL; if(D3D12_Debug_RT_Auditing()) { - RDCLOG("Recording %s dynamic build to %llx on %s", + RDCLOG("Recording %s dynamic build to %llx on %s at EID %u offset %u", AccStructDesc.Inputs.Type == D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL ? "tlas" : "blas", - AccStructDesc.DestAccelerationStructureData, ToStr(m_Cmd->m_LastCmdListID).c_str()); + AccStructDesc.DestAccelerationStructureData, ToStr(m_Cmd->m_LastCmdListID).c_str(), + bakedCmdInfo.curEventID, m_Cmd->m_CurChunkOffset & 0xffffffff); ResourceId destASBId; D3D12BufferOffset destASBOffset;