Use same disambiguation selection for resources in all cases

* We use a different function for serialising addresses via ID+offset compared
  to the normal lookup, since on serialise we need to allow out of bounds
  references as that's legal in D3D12 too. If we have a mismatch here we could
  mark one buffer referenced but serialise as another and be unable to translate
  the address.
This commit is contained in:
baldurk
2024-06-24 11:34:51 +01:00
parent 34003e96c6
commit b6bc8fe80f
+9
View File
@@ -2395,6 +2395,15 @@ void GPUAddressRangeTracker::GetResIDFromAddrAllowOutOfBounds(D3D12_GPU_VIRTUAL_
return;
range = *it;
// find the largest resource containing this address - not perfect but helps with trivially bad
// aliases where a tiny resource and a large resource are co-situated and the larger resource
// needs to be used for validity
while((it + 1)->start <= addr && (it + 1)->realEnd > range.realEnd)
{
it++;
range = *it;
}
}
if(addr < range.start)