Do not read baked command list info with ResourceId()

Avoid creating a default entry in the map
This commit is contained in:
Jake Turner
2026-07-23 09:06:41 +01:00
parent 341eb8f6f4
commit e69f436d7b
2 changed files with 11 additions and 6 deletions
+3 -2
View File
@@ -2440,10 +2440,11 @@ void D3D12CommandData::AddAction(const ActionDescription &a)
{
D3D12ActionTreeNode node(action);
node.resourceUsage.swap(m_BakedCmdListInfo[m_LastCmdListID].resourceUsage);
if(m_LastCmdListID != ResourceId())
{
node.resourceUsage.swap(m_BakedCmdListInfo[m_LastCmdListID].resourceUsage);
AddUsage(m_BakedCmdListInfo[m_LastCmdListID].state, node);
}
for(const ActionDescription &child : action.children)
node.children.push_back(D3D12ActionTreeNode(child));
+8 -4
View File
@@ -5825,8 +5825,9 @@ void WrappedID3D12Device::ReplayLog(uint32_t startEventID, uint32_t endEventID,
else
{
// Copy the state in case m_RenderState was modified externally for the partial replay.
cmd.m_BakedCmdListInfo[cmd.m_Partial[D3D12CommandData::Primary].partialParent].state =
cmd.m_RenderState;
ResourceId cmdList = cmd.m_Partial[D3D12CommandData::Primary].partialParent;
if(cmdList != ResourceId())
cmd.m_BakedCmdListInfo[cmdList].state = cmd.m_RenderState;
}
// we'll need our own command list if we're replaying just a subsection
@@ -5875,8 +5876,11 @@ void WrappedID3D12Device::ReplayLog(uint32_t startEventID, uint32_t endEventID,
if(HasFatalError())
return;
cmd.m_RenderState =
cmd.m_BakedCmdListInfo[cmd.m_Partial[D3D12CommandData::Primary].partialParent].state;
ResourceId cmdList = cmd.m_Partial[D3D12CommandData::Primary].partialParent;
if(cmdList != ResourceId())
cmd.m_RenderState = cmd.m_BakedCmdListInfo[cmdList].state;
else
cmd.m_RenderState = D3D12RenderState();
cmd.m_RenderState.ResolvePendingIndirectState(this);
if(D3D12_Debug_SingleSubmitFlushing())