summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2016-12-15 17:33:57 +0100
committerGitHub <noreply@github.com>2016-12-15 17:33:57 +0100
commit0e0325739312b8fe33b728d039fd76faf891d31f (patch)
tree9b13959bffec5fd7d65527551f2076eb8e9c985c
parentMerge pull request #2317 from yuriks/vertex-copy (diff)
parentMemory: Always flush whole pages from surface cache (diff)
downloadyuzu-0e0325739312b8fe33b728d039fd76faf891d31f.tar
yuzu-0e0325739312b8fe33b728d039fd76faf891d31f.tar.gz
yuzu-0e0325739312b8fe33b728d039fd76faf891d31f.tar.bz2
yuzu-0e0325739312b8fe33b728d039fd76faf891d31f.tar.lz
yuzu-0e0325739312b8fe33b728d039fd76faf891d31f.tar.xz
yuzu-0e0325739312b8fe33b728d039fd76faf891d31f.tar.zst
yuzu-0e0325739312b8fe33b728d039fd76faf891d31f.zip
Diffstat (limited to '')
-rw-r--r--src/core/memory.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index 65e4bba85..d058dc844 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -357,14 +357,24 @@ void RasterizerMarkRegionCached(PAddr start, u32 size, int count_delta) {
}
}
+static void RoundToPages(PAddr& start, u32& size) {
+ PAddr start_rounded_down = start & ~PAGE_MASK;
+ PAddr end_rounded_up = ((start + size) + PAGE_MASK) & ~PAGE_MASK;
+
+ start = start_rounded_down;
+ size = end_rounded_up - start_rounded_down;
+}
+
void RasterizerFlushRegion(PAddr start, u32 size) {
if (VideoCore::g_renderer != nullptr) {
+ RoundToPages(start, size);
VideoCore::g_renderer->Rasterizer()->FlushRegion(start, size);
}
}
void RasterizerFlushAndInvalidateRegion(PAddr start, u32 size) {
if (VideoCore::g_renderer != nullptr) {
+ RoundToPages(start, size);
VideoCore::g_renderer->Rasterizer()->FlushAndInvalidateRegion(start, size);
}
}