diff --git a/src/core/memory.cpp b/src/core/memory.cpp index eabc6dfccb..837016de1d 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -757,7 +757,7 @@ struct Memory::Impl { }; auto& gpu = system.GPU(); gpu_device_memory->ApplyOpOnPointer( - p, scratch_buffers[core], [&](DAddr address) { gpu.InvalidateRegion(address, size, true); }); + p, scratch_buffers[core], [&](DAddr address) { gpu.InvalidateRegion(address, size); }); } Core::System& system; diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 1621b24125..9901cf4262 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp @@ -226,19 +226,7 @@ struct GPU::Impl { } /// Notify rasterizer that any caches of the specified region should be invalidated - void InvalidateRegion(DAddr addr, u64 size, bool preserve_gpu_writes) { - if (preserve_gpu_writes) { - VideoCore::RasterizerInterface* rasterizer = renderer->ReadRasterizer(); - if (!rasterizer->TryCacheInvalidation(addr, size)) { - const u64 fence = RequestSyncOperation([rasterizer, addr, size] { - rasterizer->FlushRegion(addr, size, VideoCommon::CacheType::BufferCache); - rasterizer->OnCacheInvalidation(addr, size); - }); - gpu_thread.TickGPU(is_async); - WaitForSyncOperation(fence); - } - return; - } + void InvalidateRegion(DAddr addr, u64 size) { gpu_thread.InvalidateRegion(addr, size); } @@ -530,8 +518,8 @@ void GPU::FlushRegion(DAddr addr, u64 size) { impl->FlushRegion(addr, size); } -void GPU::InvalidateRegion(DAddr addr, u64 size, bool preserve_gpu_writes) { - impl->InvalidateRegion(addr, size, preserve_gpu_writes); +void GPU::InvalidateRegion(DAddr addr, u64 size) { + impl->InvalidateRegion(addr, size); } bool GPU::OnCPUWrite(DAddr addr, u64 size) { diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index 974d214e10..75956ea199 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h @@ -248,7 +248,7 @@ public: void FlushRegion(DAddr addr, u64 size); /// Notify rasterizer that any caches of the specified region should be invalidated - void InvalidateRegion(DAddr addr, u64 size, bool preserve_gpu_writes = false); + void InvalidateRegion(DAddr addr, u64 size); /// Notify rasterizer that CPU is trying to write this area. It returns true if the area is /// sensible, false otherwise, addr and size must be a valid combination diff --git a/src/video_core/rasterizer_interface.h b/src/video_core/rasterizer_interface.h index b527c0e2a9..06cb8b7aba 100644 --- a/src/video_core/rasterizer_interface.h +++ b/src/video_core/rasterizer_interface.h @@ -114,12 +114,6 @@ public: /// Notify rasterizer that any caches of the specified region are desync with guest virtual void OnCacheInvalidation(PAddr addr, u64 size) = 0; - virtual bool TryCacheInvalidation(DAddr addr, u64 size) { - if (MustFlushRegion(addr, size, VideoCommon::CacheType::BufferCache)) return false; - OnCacheInvalidation(addr, size); - return true; - } - virtual bool OnCPUWrite(PAddr addr, u64 size) = 0; /// Sync memory between guest and host. diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 264ffb28b5..f43bea1220 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -798,18 +798,6 @@ void RasterizerVulkan::OnCacheInvalidation(DAddr addr, u64 size) { pipeline_cache.InvalidateRegion(addr, size); } -bool RasterizerVulkan::TryCacheInvalidation(DAddr addr, u64 size) { - if (addr == 0 || size == 0) return true; - { - std::scoped_lock lock{buffer_cache.mutex, texture_cache.mutex}; - if (buffer_cache.IsRegionGpuModified(addr, size)) return false; - texture_cache.WriteMemory(addr, size); - buffer_cache.WriteMemory(addr, size); - } - pipeline_cache.InvalidateRegion(addr, size); - return true; -} - void RasterizerVulkan::InvalidateGPUCache() { gpu.InvalidateGPUCache(); } diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index ae9929ca0b..7470aa4f14 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h @@ -106,7 +106,6 @@ public: VideoCommon::CacheType which = VideoCommon::CacheType::All) override; void InnerInvalidation(std::span> sequences) override; void OnCacheInvalidation(DAddr addr, u64 size) override; - bool TryCacheInvalidation(DAddr addr, u64 size) override; bool OnCPUWrite(DAddr addr, u64 size) override; void InvalidateGPUCache() override; void UnmapMemory(DAddr addr, u64 size) override;