Skip to content

Commit

Permalink
Handle getting descriptor access at EIDs where root params are unbound
Browse files Browse the repository at this point in the history
  • Loading branch information
baldurk committed May 28, 2024
1 parent 11463be commit 45db4fe
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions renderdoc/driver/d3d12/d3d12_replay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1964,6 +1964,14 @@ rdcarray<DescriptorAccess> D3D12Replay::GetDescriptorAccess(uint32_t eventId)
continue;
}

// otherwise the access may be to a rootsig element that's not bound if the current event is
// not a valid draw or dispatch
if(rootIndex >= rootSig.sigelems.size())
{
access.descriptorStore = ResourceId();
continue;
}

const D3D12RenderState::SignatureElement &rootEl = rootSig.sigelems[rootIndex];

// this indicates a root parameter
Expand All @@ -1982,6 +1990,10 @@ rdcarray<DescriptorAccess> D3D12Replay::GetDescriptorAccess(uint32_t eventId)
access.byteOffset += (uint32_t)rootEl.offset;
}
}

// remove any invalid / unbound root element accesses
ret.removeIf(
[](const DescriptorAccess &access) { return access.descriptorStore == ResourceId(); });
}

return ret;
Expand Down

0 comments on commit 45db4fe

Please sign in to comment.