From 23cc4ac221a32940e77d77d37cba16683722ef6a Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Mon, 24 Nov 2025 01:20:49 -0400 Subject: [PATCH] [vk, rasterizer] Reduce FlushWork constant drawcalls --- src/video_core/renderer_vulkan/vk_rasterizer.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 316a4e59af..d6a0ca8984 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -863,23 +863,21 @@ void RasterizerVulkan::LoadDiskResources(u64 title_id, std::stop_token stop_load void RasterizerVulkan::FlushWork() { #ifdef ANDROID - static constexpr u32 DRAWS_TO_DISPATCH = 1024; + static constexpr u32 DRAWS_TO_DISPATCH = 512; + static constexpr u32 CHECK_MASK = 3; #else static constexpr u32 DRAWS_TO_DISPATCH = 4096; + static constexpr u32 CHECK_MASK = 7; #endif // ANDROID - // Only check multiples of 8 draws - static_assert(DRAWS_TO_DISPATCH % 8 == 0); - if ((++draw_counter & 7) != 7) { + static_assert(DRAWS_TO_DISPATCH % (CHECK_MASK + 1) == 0); + if ((++draw_counter & CHECK_MASK) != CHECK_MASK) { return; } if (draw_counter < DRAWS_TO_DISPATCH) { - // Send recorded tasks to the worker thread scheduler.DispatchWork(); return; } - // Otherwise (every certain number of draws) flush execution. - // This submits commands to the Vulkan driver. scheduler.Flush(); draw_counter = 0; }