diff options
| author | 2019-09-21 20:07:25 +1000 | |
|---|---|---|
| committer | 2019-09-21 20:07:25 +1000 | |
| commit | c7c8ffbc137412226e4cbe40e567b7d7fb1a8799 (patch) | |
| tree | 43aa0549a5cb209e311963ffb2e17f1f515d87ca /src/core/memory.cpp | |
| parent | Merge pull request #2576 from DarkLordZach/nsp-fix-1 (diff) | |
| parent | Core/Memory: Only FlushAndInvalidate GPU if the page is marked as RasterizerC... (diff) | |
| download | yuzu-c7c8ffbc137412226e4cbe40e567b7d7fb1a8799.tar.gz yuzu-c7c8ffbc137412226e4cbe40e567b7d7fb1a8799.tar.xz yuzu-c7c8ffbc137412226e4cbe40e567b7d7fb1a8799.zip | |
Merge pull request #2872 from FernandoS27/mem-gpu-opt
Core/Memory: Only FlushAndInvalidate GPU if the page is marked as RasterizerCachedMemory
Diffstat (limited to 'src/core/memory.cpp')
| -rw-r--r-- | src/core/memory.cpp | 9 |
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 | |||
| 43 | 43 | ||
| 44 | // During boot, current_page_table might not be set yet, in which case we need not flush | 44 | // During boot, current_page_table might not be set yet, in which case we need not flush |
| 45 | if (Core::System::GetInstance().IsPoweredOn()) { | 45 | if (Core::System::GetInstance().IsPoweredOn()) { |
| 46 | Core::System::GetInstance().GPU().FlushAndInvalidateRegion(base << PAGE_BITS, | 46 | auto& gpu = Core::System::GetInstance().GPU(); |
| 47 | size * PAGE_SIZE); | 47 | for (u64 i = 0; i < size; i++) { |
| 48 | const auto page = base + i; | ||
| 49 | if (page_table.attributes[page] == Common::PageType::RasterizerCachedMemory) { | ||
| 50 | gpu.FlushAndInvalidateRegion(page << PAGE_BITS, PAGE_SIZE); | ||
| 51 | } | ||
| 52 | } | ||
| 48 | } | 53 | } |
| 49 | 54 | ||
| 50 | VAddr end = base + size; | 55 | VAddr end = base + size; |