Use the largest possible resource when resolving addr -> resource

* There is ambiguity here and it seems that sometimes the runtime will care
  about which resource is picked even if they overlap.
This commit is contained in:
baldurk
2024-06-21 16:42:12 +01:00
parent 0cc4cdedb6
commit 51c13435f5
+9
View File
@@ -2357,6 +2357,15 @@ void GPUAddressRangeTracker::GetResIDFromAddr(D3D12_GPU_VIRTUAL_ADDRESS addr, Re
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 || addr >= range.realEnd)