diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-01-01 22:03:37 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-10-06 21:00:52 +0200 |
commit | f350c3d74ea7880fc6d21f7f638b0d4a70a3246b (patch) | |
tree | 30927fa3c736f5b758a0a971a2d95114d8f8d5fa /src/video_core/memory_manager.cpp | |
parent | Texture cache: Fix dangling references on multichannel. (diff) | |
download | yuzu-f350c3d74ea7880fc6d21f7f638b0d4a70a3246b.tar yuzu-f350c3d74ea7880fc6d21f7f638b0d4a70a3246b.tar.gz yuzu-f350c3d74ea7880fc6d21f7f638b0d4a70a3246b.tar.bz2 yuzu-f350c3d74ea7880fc6d21f7f638b0d4a70a3246b.tar.lz yuzu-f350c3d74ea7880fc6d21f7f638b0d4a70a3246b.tar.xz yuzu-f350c3d74ea7880fc6d21f7f638b0d4a70a3246b.tar.zst yuzu-f350c3d74ea7880fc6d21f7f638b0d4a70a3246b.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/memory_manager.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp index d4c0dca78..b36067613 100644 --- a/src/video_core/memory_manager.cpp +++ b/src/video_core/memory_manager.cpp @@ -59,10 +59,19 @@ GPUVAddr MemoryManager::PageTableOp(GPUVAddr gpu_addr, [[maybe_unused]] VAddr cp } for (u64 offset{}; offset < size; offset += page_size) { const GPUVAddr current_gpu_addr = gpu_addr + offset; + [[maybe_unused]] const auto current_entry_type = GetEntry(current_gpu_addr); SetEntry(current_gpu_addr, entry_type); + if (current_entry_type != entry_type) { + rasterizer->ModifyGPUMemory(unique_identifier, gpu_addr, page_size); + } if constexpr (entry_type == EntryType::Mapped) { const VAddr current_cpu_addr = cpu_addr + offset; const auto index = PageEntryIndex(current_gpu_addr); + const u32 sub_value = static_cast<u32>(current_cpu_addr >> 12ULL); + if (current_entry_type == entry_type && sub_value != page_table[index]) { + rasterizer->InvalidateRegion(static_cast<VAddr>(page_table[index]) << 12ULL, + page_size); + } page_table[index] = static_cast<u32>(current_cpu_addr >> 12ULL); } remaining_size -= page_size; @@ -168,7 +177,7 @@ std::optional<VAddr> MemoryManager::GpuToCpuAddress(GPUVAddr addr, std::size_t s const size_t page_last{(addr + size + page_size - 1) >> page_bits}; while (page_index < page_last) { const auto page_addr{GpuToCpuAddress(page_index << page_bits)}; - if (page_addr && *page_addr != 0) { + if (page_addr) { return page_addr; } ++page_index; |