From d18cda5a5dd886fe79755db27eaaf4a8f5eb01f5 Mon Sep 17 00:00:00 2001 From: Weiyi Wang Date: Wed, 21 Nov 2018 16:03:28 -0500 Subject: [PATCH] Memory: move MarkRegionCached into class --- src/core/memory.cpp | 2 +- src/core/memory.h | 10 +++++----- src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 6 ++++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 7e2d347e73..763b305ed9 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -305,7 +305,7 @@ static std::vector PhysicalToVirtualAddressForRasterizer(PAddr addr) { return {}; } -void RasterizerMarkRegionCached(PAddr start, u32 size, bool cached) { +void MemorySystem::RasterizerMarkRegionCached(PAddr start, u32 size, bool cached) { if (start == 0) { return; } diff --git a/src/core/memory.h b/src/core/memory.h index 33a2918cf7..049a1b6f07 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -180,11 +180,6 @@ enum : VAddr { extern std::array fcram; -/** - * Mark each page touching the region as cached. - */ -void RasterizerMarkRegionCached(PAddr start, u32 size, bool cached); - /** * Flushes any externally cached rasterizer resources touching the given region. */ @@ -258,6 +253,11 @@ public: /// Gets offset in FCRAM from a pointer inside FCRAM range u32 GetFCRAMOffset(u8* pointer); + /** + * Mark each page touching the region as cached. + */ + void RasterizerMarkRegionCached(PAddr start, u32 size, bool cached); + private: template T Read(const VAddr vaddr); diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 6342ede2a2..51fe40d49e 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp @@ -1718,9 +1718,11 @@ void RasterizerCacheOpenGL::UpdatePagesCachedCount(PAddr addr, u32 size, int del const u32 interval_size = interval_end_addr - interval_start_addr; if (delta > 0 && count == delta) - Memory::RasterizerMarkRegionCached(interval_start_addr, interval_size, true); + VideoCore::g_memory->RasterizerMarkRegionCached(interval_start_addr, interval_size, + true); else if (delta < 0 && count == -delta) - Memory::RasterizerMarkRegionCached(interval_start_addr, interval_size, false); + VideoCore::g_memory->RasterizerMarkRegionCached(interval_start_addr, interval_size, + false); else ASSERT(count >= 0); }