From 9d616e5951f89a602aa822ecdca6a0d7287f36dd Mon Sep 17 00:00:00 2001 From: Weiyi Wang Date: Mon, 10 Dec 2018 22:05:28 -0500 Subject: [PATCH] Memory: mark pages on mapping if it is already rasterizer-cached --- src/core/memory.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 75667ad2a6..cfb42c30c0 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -100,6 +100,12 @@ void MemorySystem::MapPages(PageTable& page_table, u32 base, u32 size, u8* memor page_table.attributes[base] = type; page_table.pointers[base] = memory; + // If the memory to map is already rasterizer-cached, mark the page + if (type == PageType::Memory && impl->cache_marker.IsCached(base * PAGE_SIZE)) { + page_table.attributes[base] = PageType::RasterizerCachedMemory; + page_table.pointers[base] = nullptr; + } + base += 1; if (memory != nullptr) memory += PAGE_SIZE;