From c3218452c1a7e9bcdea3f9f21884791a5898ed51 Mon Sep 17 00:00:00 2001 From: Takoroka <137927095+Takoroka@users.noreply.github.com> Date: Thu, 29 Oct 2026 00:54:02 -0400 Subject: vulkan: one lock for both caches in InnerInvalidation It runs before most draws (constant buffer updates go through the invalidation accumulator) and took the texture and buffer cache mutexes one after the other. --- src/video_core/renderer_vulkan/vk_rasterizer.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/video_core/renderer_vulkan/vk_rasterizer.cpp') diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 6bd267e566..886c5dbfe4 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -1036,13 +1036,11 @@ void RasterizerVulkan::InvalidateRegion(DAddr addr, u64 size, VideoCommon::Cache void RasterizerVulkan::InnerInvalidation(std::span> sequences) { { - std::scoped_lock lock{texture_cache.mutex}; + // Both caches under one lock: this runs before most draws (constant buffer updates). + std::scoped_lock lock{buffer_cache.mutex, texture_cache.mutex}; for (const auto& [addr, size] : sequences) { texture_cache.WriteMemory(addr, size); } - } - { - std::scoped_lock lock{buffer_cache.mutex}; for (const auto& [addr, size] : sequences) { buffer_cache.WriteMemory(addr, size); } -- cgit v1.2.3