diff options
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 28 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.h | 6 |
2 files changed, 21 insertions, 13 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 58c69b786..0ca72eb45 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -495,20 +495,28 @@ void RasterizerVulkan::Query(GPUVAddr gpu_addr, VideoCore::QueryType type, void RasterizerVulkan::FlushAll() {} -void RasterizerVulkan::FlushRegion(CacheAddr addr, u64 size) { - texture_cache.FlushRegion(addr, size); - buffer_cache.FlushRegion(addr, size); - query_cache.FlushRegion(addr, size); +void RasterizerVulkan::FlushRegion(VAddr addr, u64 size) { + if (!addr || !size) { + return; + } + CacheAddr cache_addr = ToCacheAddr(system.Memory().GetPointer(addr)); + texture_cache.FlushRegion(cache_addr, size); + buffer_cache.FlushRegion(cache_addr, size); + query_cache.FlushRegion(cache_addr, size); } -void RasterizerVulkan::InvalidateRegion(CacheAddr addr, u64 size) { - texture_cache.InvalidateRegion(addr, size); - pipeline_cache.InvalidateRegion(addr, size); - buffer_cache.InvalidateRegion(addr, size); - query_cache.InvalidateRegion(addr, size); +void RasterizerVulkan::InvalidateRegion(VAddr addr, u64 size) { + if (!addr || !size) { + return; + } + CacheAddr cache_addr = ToCacheAddr(system.Memory().GetPointer(addr)); + texture_cache.InvalidateRegion(cache_addr, size); + pipeline_cache.InvalidateRegion(cache_addr, size); + buffer_cache.InvalidateRegion(cache_addr, size); + query_cache.InvalidateRegion(cache_addr, size); } -void RasterizerVulkan::FlushAndInvalidateRegion(CacheAddr addr, u64 size) { +void RasterizerVulkan::FlushAndInvalidateRegion(VAddr addr, u64 size) { FlushRegion(addr, size); InvalidateRegion(addr, size); } diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index 3185868e9..f642dde76 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h @@ -118,9 +118,9 @@ public: void ResetCounter(VideoCore::QueryType type) override; void Query(GPUVAddr gpu_addr, VideoCore::QueryType type, std::optional<u64> timestamp) override; void FlushAll() override; - void FlushRegion(CacheAddr addr, u64 size) override; - void InvalidateRegion(CacheAddr addr, u64 size) override; - void FlushAndInvalidateRegion(CacheAddr addr, u64 size) override; + void FlushRegion(VAddr addr, u64 size) override; + void InvalidateRegion(VAddr addr, u64 size) override; + void FlushAndInvalidateRegion(VAddr addr, u64 size) override; void FlushCommands() override; void TickFrame() override; bool AccelerateSurfaceCopy(const Tegra::Engines::Fermi2D::Regs::Surface& src, |