diff --git a/renderdoc/driver/d3d12/d3d12_replay.cpp b/renderdoc/driver/d3d12/d3d12_replay.cpp index d8f11a079..0f42fd860 100644 --- a/renderdoc/driver/d3d12/d3d12_replay.cpp +++ b/renderdoc/driver/d3d12/d3d12_replay.cpp @@ -1964,6 +1964,14 @@ rdcarray 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 @@ -1982,6 +1990,10 @@ rdcarray 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;