Skip to content

Commit 45db4fe

Browse files
committed
Handle getting descriptor access at EIDs where root params are unbound
1 parent 11463be commit 45db4fe

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

renderdoc/driver/d3d12/d3d12_replay.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1964,6 +1964,14 @@ rdcarray<DescriptorAccess> D3D12Replay::GetDescriptorAccess(uint32_t eventId)
19641964
continue;
19651965
}
19661966

1967+
// otherwise the access may be to a rootsig element that's not bound if the current event is
1968+
// not a valid draw or dispatch
1969+
if(rootIndex >= rootSig.sigelems.size())
1970+
{
1971+
access.descriptorStore = ResourceId();
1972+
continue;
1973+
}
1974+
19671975
const D3D12RenderState::SignatureElement &rootEl = rootSig.sigelems[rootIndex];
19681976

19691977
// this indicates a root parameter
@@ -1982,6 +1990,10 @@ rdcarray<DescriptorAccess> D3D12Replay::GetDescriptorAccess(uint32_t eventId)
19821990
access.byteOffset += (uint32_t)rootEl.offset;
19831991
}
19841992
}
1993+
1994+
// remove any invalid / unbound root element accesses
1995+
ret.removeIf(
1996+
[](const DescriptorAccess &access) { return access.descriptorStore == ResourceId(); });
19851997
}
19861998

19871999
return ret;

0 commit comments

Comments
 (0)