validate that root signatures don't have gaps

This commit is contained in:
myT 2023-12-18 00:49:26 +01:00
parent 6396ca0ef3
commit 455408faa6

View file

@ -32,7 +32,6 @@ to do:
- use Application Verifier to catch issues
- tone mapping: look at https://github.com/h3r2tic/tony-mc-mapface
- ubershader PS: run-time alpha test evaluation to reduce PSO count?
- when creating the root signature, validate that neither of the tables have any gap
- use root signature 1.1 to use the hints that help the drivers optimize out static resources
- is it possible to force Resource Binding Tier 2 somehow? are we supposed to run on old HW to test? :(
see if WARP allows us to do that?
@ -3603,6 +3602,7 @@ namespace RHI
//
// CBV SRV UAV table
//
uint32_t onePastLastTableIndex = 0;
D3D12_DESCRIPTOR_RANGE genericRanges[ARRAY_LEN(rhiDesc.genericRanges)] = {};
for(uint32_t rangeIndex = 0; rangeIndex < rhiDesc.genericRangeCount; ++rangeIndex)
{
@ -3620,7 +3620,13 @@ namespace RHI
r.RegisterSpace = 1;
}
rhiSignature.genericDescCount += rIn.count;
onePastLastTableIndex = max(onePastLastTableIndex, rIn.firstIndex + rIn.count);
}
// if you trigger this, you have at least 1 gap in your root signature
Q_assert(onePastLastTableIndex == rhiSignature.genericDescCount);
rhiSignature.genericDescCount = onePastLastTableIndex; // safety net...
if(rhiSignature.genericDescCount > 0)
{
rhiSignature.genericTableIndex = parameterCount;