Skip to content

Commit

Permalink
Remap addresses to live in indirect dispatch on replay
Browse files Browse the repository at this point in the history
  • Loading branch information
baldurk committed Jun 18, 2024
1 parent a8281e9 commit f74a119
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down
7 changes: 7 additions & 0 deletions renderdoc/driver/d3d12/d3d12_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,13 @@ rdcpair<ID3D12Resource *, UINT64> 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;
}
Expand Down

0 comments on commit f74a119

Please sign in to comment.