diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-02-19 14:18:02 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-10-06 21:00:53 +0200 |
commit | 5a568b1655f0d721891083da19e2da2614796389 (patch) | |
tree | 540d2c564bf84114484188000a871e90cf5e7772 /src/video_core | |
parent | Shader Decompiler: implement better tracking for Vulkan samplers. (diff) | |
download | yuzu-5a568b1655f0d721891083da19e2da2614796389.tar yuzu-5a568b1655f0d721891083da19e2da2614796389.tar.gz yuzu-5a568b1655f0d721891083da19e2da2614796389.tar.bz2 yuzu-5a568b1655f0d721891083da19e2da2614796389.tar.lz yuzu-5a568b1655f0d721891083da19e2da2614796389.tar.xz yuzu-5a568b1655f0d721891083da19e2da2614796389.tar.zst yuzu-5a568b1655f0d721891083da19e2da2614796389.zip |
Diffstat (limited to 'src/video_core')
-rw-r--r-- | src/video_core/memory_manager.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp index e1a8b5391..0f97db272 100644 --- a/src/video_core/memory_manager.cpp +++ b/src/video_core/memory_manager.cpp @@ -134,11 +134,15 @@ GPUVAddr MemoryManager::BigPageTableOp(GPUVAddr gpu_addr, [[maybe_unused]] VAddr big_page_table_cpu[index] = sub_value; const bool is_continous = ([&] { uintptr_t base_ptr{ - reinterpret_cast<uintptr_t>(memory.GetPointer(current_cpu_addr))}; + reinterpret_cast<uintptr_t>(memory.GetPointerSilent(current_cpu_addr))}; + if (base_ptr == 0) { + return false; + } for (VAddr start_cpu = current_cpu_addr + page_size; start_cpu < current_cpu_addr + big_page_size; start_cpu += page_size) { base_ptr += page_size; - if (base_ptr != reinterpret_cast<uintptr_t>(memory.GetPointer(start_cpu))) { + auto next_ptr = reinterpret_cast<uintptr_t>(memory.GetPointerSilent(start_cpu)); + if (next_ptr == 0 || base_ptr != next_ptr) { return false; } } @@ -359,7 +363,7 @@ void MemoryManager::ReadBlockImpl(GPUVAddr gpu_src_addr, void* dest_buffer, if constexpr (is_safe) { rasterizer->FlushRegion(cpu_addr_base, copy_amount); } - if (!IsBigPageContinous(page_index)) { + if (!IsBigPageContinous(page_index)) [[unlikely]] { memory.ReadBlockUnsafe(cpu_addr_base, dest_buffer, copy_amount); } else { u8* physical = memory.GetPointer(cpu_addr_base); @@ -407,7 +411,7 @@ void MemoryManager::WriteBlockImpl(GPUVAddr gpu_dest_addr, const void* src_buffe if constexpr (is_safe) { rasterizer->InvalidateRegion(cpu_addr_base, copy_amount); } - if (!IsBigPageContinous(page_index)) { + if (!IsBigPageContinous(page_index)) [[unlikely]] { memory.WriteBlockUnsafe(cpu_addr_base, src_buffer, copy_amount); } else { u8* physical = memory.GetPointer(cpu_addr_base); |