mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-19 18:36:53 +02:00
graphics: synchronize host file writes and depth clipping
Map paired PS5 depth-clip state through Vulkan pipeline creation and preserve asymmetric hard failures. Prepare GPU-mapped guest ranges before kernel file reads so buffer, texture, and alias ownership remains coherent. Add focused regression coverage and update the current launch target.
This commit is contained in:
@@ -168,6 +168,36 @@ void TestSharedWatcherFault() {
|
||||
Check(VirtualFree(memory, 0, MEM_RELEASE) != 0, "VirtualFree failed");
|
||||
}
|
||||
|
||||
void TestMappedHostWriteRange() {
|
||||
FaultContext context;
|
||||
PageManager manager(InvalidateFault, &context);
|
||||
context.manager = &manager;
|
||||
const auto page_size = manager.GetPageSize();
|
||||
auto *memory = Allocate(page_size * 3);
|
||||
const auto address = reinterpret_cast<uint64_t>(memory);
|
||||
|
||||
manager.OnGpuMap(address, page_size);
|
||||
manager.OnGpuMap(address + page_size * 2, page_size);
|
||||
manager.UpdatePageWatchers(true, address, page_size);
|
||||
manager.UpdatePageWatchers(true, address + page_size * 2, page_size);
|
||||
Check(manager.HasAnyMapping(address + 16, page_size * 3 - 32),
|
||||
"host-write range did not find partial GPU mappings");
|
||||
Check(!manager.IsMapped(address, page_size * 3),
|
||||
"partial GPU mappings were reported as a full mapping");
|
||||
Check(manager.HandleWriteRange(address + 16, page_size * 3 - 32),
|
||||
"mapped host-write range was not handled");
|
||||
Check(context.calls.load(std::memory_order_relaxed) == 2,
|
||||
"host-write range did not invalidate each mapped watched page");
|
||||
Check(IsWritable(memory) && IsWritable(memory + page_size * 2),
|
||||
"host-write range did not restore writable protection");
|
||||
|
||||
manager.OnGpuUnmap(address, page_size);
|
||||
manager.OnGpuUnmap(address + page_size * 2, page_size);
|
||||
Check(!manager.HasAnyMapping(address, page_size * 3),
|
||||
"host-write range retained stale GPU mappings");
|
||||
Check(VirtualFree(memory, 0, MEM_RELEASE) != 0, "VirtualFree failed");
|
||||
}
|
||||
|
||||
void TestReadWriteWatcherFault() {
|
||||
FaultContext context;
|
||||
PageManager manager(InvalidateFault, &context);
|
||||
@@ -607,6 +637,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
TestWatchFaultAndUnwatch();
|
||||
TestSharedWatcherFault();
|
||||
TestMappedHostWriteRange();
|
||||
TestReadWriteWatcherFault();
|
||||
TestPermittedMappedLateFaultsResume();
|
||||
TestPartialMappingUnmapPreservesTokens();
|
||||
|
||||
Reference in New Issue
Block a user