summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-09-19 03:50:21 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2019-09-19 04:47:22 +0200
commit50259d7bdc5f36309e100d1be5ee6e4900a746fa (patch)
treec350b367b90ae1ccb16588d973cc3571ba262e75 /src
parentMerge pull request #2784 from ReinUsesLisp/smem (diff)
downloadyuzu-50259d7bdc5f36309e100d1be5ee6e4900a746fa.tar
yuzu-50259d7bdc5f36309e100d1be5ee6e4900a746fa.tar.gz
yuzu-50259d7bdc5f36309e100d1be5ee6e4900a746fa.tar.bz2
yuzu-50259d7bdc5f36309e100d1be5ee6e4900a746fa.tar.lz
yuzu-50259d7bdc5f36309e100d1be5ee6e4900a746fa.tar.xz
yuzu-50259d7bdc5f36309e100d1be5ee6e4900a746fa.tar.zst
yuzu-50259d7bdc5f36309e100d1be5ee6e4900a746fa.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/memory.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index 8555691c0..9e030789d 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -43,8 +43,13 @@ static void MapPages(Common::PageTable& page_table, VAddr base, u64 size, u8* me
// During boot, current_page_table might not be set yet, in which case we need not flush
if (Core::System::GetInstance().IsPoweredOn()) {
- Core::System::GetInstance().GPU().FlushAndInvalidateRegion(base << PAGE_BITS,
- size * PAGE_SIZE);
+ auto& gpu = Core::System::GetInstance().GPU();
+ for (u64 i = 0; i < size; i++) {
+ const auto page = base + i;
+ if (page_table.attributes[page] == Common::PageType::RasterizerCachedMemory) {
+ gpu.FlushAndInvalidateRegion(page << PAGE_BITS, PAGE_SIZE);
+ }
+ }
}
VAddr end = base + size;