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.
This commit is contained in:
baldurk
2026-05-05 15:58:36 +01:00
parent c59b80b69e
commit 13b6d9a854
@@ -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;