From 63d3924b5bb5dd17f1de9dfe3a357df293fc113d Mon Sep 17 00:00:00 2001 From: bunnei Date: Thu, 22 Mar 2018 22:56:41 -0400 Subject: memory: Port RasterizerFlushVirtualRegion from Citra. --- src/core/memory.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/core/memory.h') diff --git a/src/core/memory.h b/src/core/memory.h index f406cc848..1c7232115 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -36,7 +36,10 @@ enum class PageType : u8 { Unmapped, /// Page is mapped to regular memory. This is the only type you can get pointers to. Memory, - /// Page is mapped to a memory hook, which intercepts read and write requests. + /// Page is mapped to regular memory, but also needs to check for rasterizer cache flushing and + /// invalidation + RasterizerCachedMemory, + /// Page is mapped to a I/O region. Writing and reading to this page is handled by functions. Special, }; @@ -253,4 +256,19 @@ boost::optional PhysicalToVirtualAddress(PAddr addr); */ u8* GetPhysicalPointer(PAddr address); +enum class FlushMode { + /// Write back modified surfaces to RAM + Flush, + /// Remove region from the cache + Invalidate, + /// 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); + } // namespace Memory -- cgit v1.2.3 From 11047d7fd511fd9ae6130da7bc824fefa6fb64c1 Mon Sep 17 00:00:00 2001 From: bunnei Date: Fri, 23 Mar 2018 15:01:45 -0400 Subject: rasterizer: Flush and invalidate regions should be 64-bit. --- src/core/memory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/memory.h') diff --git a/src/core/memory.h b/src/core/memory.h index 1c7232115..3e2c3f23d 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -269,6 +269,6 @@ enum class FlushMode { * Flushes and invalidates any externally cached rasterizer resources touching the given virtual * address region. */ -void RasterizerFlushVirtualRegion(VAddr start, u32 size, FlushMode mode); +void RasterizerFlushVirtualRegion(VAddr start, u64 size, FlushMode mode); } // namespace Memory -- cgit v1.2.3