From d5531357487a144cf962ce08a912417fd5e61570 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Wed, 21 Jun 2017 22:48:00 -0700 Subject: Memory: Add function to flush a virtual range from the rasterizer cache This is slightly more ergonomic to use, correctly handles virtual regions which are disjoint in physical addressing space, and checks only regions which can be cached by the rasterizer. --- src/core/memory.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/core/memory.h') diff --git a/src/core/memory.h b/src/core/memory.h index 96ce9e52e..c8c56babd 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -190,6 +190,19 @@ void RasterizerFlushRegion(PAddr start, u32 size); */ void RasterizerFlushAndInvalidateRegion(PAddr start, u32 size); +enum class FlushMode { + /// Write back modified surfaces to RAM + Flush, + /// Write back modified surfaces to RAM, and also remove them from the cache + FlushAndInvalidate, +}; + +/** + * Flushes and invalidates any externally cached rasterizer resources touching the given virtual + * address region. + */ +void RasterizerFlushVirtualRegion(VAddr start, u32 size, FlushMode mode); + /** * Dynarmic has an optimization to memory accesses when the pointer to the page exists that * can be used by setting up the current page table as a callback. This function is used to -- cgit v1.2.3