From d4e19eb58303448dada3dda6912efb8a4ea7f598 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Tue, 22 Oct 2013 21:05:32 -0700 Subject: [PATCH] Certain games seem to do GPU writeback here. --- src/xenia/core/memory.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/xenia/core/memory.cc b/src/xenia/core/memory.cc index b79d8136a..a4aa9d32e 100644 --- a/src/xenia/core/memory.cc +++ b/src/xenia/core/memory.cc @@ -174,6 +174,11 @@ xe_memory_ref xe_memory_create(xe_memory_options_t options) { memory, XE_MEMORY_PHYSICAL_HEAP_LOW, XE_MEMORY_PHYSICAL_HEAP_HIGH, true); + // GPU writeback. + VirtualAlloc( + memory->mapping_base + 0xC0000000, 0x00100000, + MEM_COMMIT, PAGE_READWRITE); + return memory; XECLEANUP: @@ -182,6 +187,11 @@ XECLEANUP: } void xe_memory_dealloc(xe_memory_ref memory) { + // GPU writeback. + VirtualFree( + memory->mapping_base + 0xC0000000, 0x00100000, + MEM_DECOMMIT); + // Cleanup heaps. memory->virtual_heap.Cleanup(); memory->physical_heap.Cleanup();