summaryrefslogtreecommitdiff
path: root/src/core/memory.h
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2017-06-21 22:48:00 -0700
committerGravatar Yuri Kunde Schlesner2017-06-21 22:57:12 -0700
commitd5531357487a144cf962ce08a912417fd5e61570 (patch)
tree22a4991545b092b5a46cc448c0359d3bfcaf253e /src/core/memory.h
parentMemory: Add TryVirtualToPhysicalAddress, returning a boost::optional (diff)
downloadyuzu-d5531357487a144cf962ce08a912417fd5e61570.tar.gz
yuzu-d5531357487a144cf962ce08a912417fd5e61570.tar.xz
yuzu-d5531357487a144cf962ce08a912417fd5e61570.zip
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.
Diffstat (limited to 'src/core/memory.h')
-rw-r--r--src/core/memory.h13
1 files changed, 13 insertions, 0 deletions
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);
190 */ 190 */
191void RasterizerFlushAndInvalidateRegion(PAddr start, u32 size); 191void RasterizerFlushAndInvalidateRegion(PAddr start, u32 size);
192 192
193enum class FlushMode {
194 /// Write back modified surfaces to RAM
195 Flush,
196 /// Write back modified surfaces to RAM, and also remove them from the cache
197 FlushAndInvalidate,
198};
199
200/**
201 * Flushes and invalidates any externally cached rasterizer resources touching the given virtual
202 * address region.
203 */
204void RasterizerFlushVirtualRegion(VAddr start, u32 size, FlushMode mode);
205
193/** 206/**
194 * Dynarmic has an optimization to memory accesses when the pointer to the page exists that 207 * Dynarmic has an optimization to memory accesses when the pointer to the page exists that
195 * can be used by setting up the current page table as a callback. This function is used to 208 * can be used by setting up the current page table as a callback. This function is used to