From 5417d4854df208cb7791b62cacdf8ab0daab8340 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sun, 15 Jun 2025 22:05:36 +0300 Subject: [PATCH] vk: Fix edge cases in descriptor update logic --- rpcs3/Emu/RSX/VK/VKProgramPipeline.cpp | 6 +++--- rpcs3/Emu/RSX/VK/VKProgramPipeline.h | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/RSX/VK/VKProgramPipeline.cpp b/rpcs3/Emu/RSX/VK/VKProgramPipeline.cpp index b5bc7642ba..892c217f6c 100644 --- a/rpcs3/Emu/RSX/VK/VKProgramPipeline.cpp +++ b/rpcs3/Emu/RSX/VK/VKProgramPipeline.cpp @@ -399,12 +399,11 @@ namespace vk { if (!set.m_device) { - break; + continue; } bind_sets[count++] = set.m_descriptor_set.value(); // Current set pointer for binding - set.m_descriptor_set.on_bind(); // Notify async queue - set.next_descriptor_set(); // Flush queue and update pointers + set.on_bind(); // Notify bind event. Internally updates handles and triggers flushing. } vkCmdBindPipeline(cmd, bind_point, m_pipeline); @@ -528,6 +527,7 @@ namespace vk m_descriptor_set.push(m_copy_cmds, type_mask); // Write previous state m_descriptor_set = allocate_descriptor_set(); + m_any_descriptors_dirty = false; } void descriptor_table_t::create_descriptor_set_layout() diff --git a/rpcs3/Emu/RSX/VK/VKProgramPipeline.h b/rpcs3/Emu/RSX/VK/VKProgramPipeline.h index d0f06e2a80..36653facf7 100644 --- a/rpcs3/Emu/RSX/VK/VKProgramPipeline.h +++ b/rpcs3/Emu/RSX/VK/VKProgramPipeline.h @@ -138,6 +138,12 @@ namespace vk VkDescriptorSet allocate_descriptor_set(); void next_descriptor_set(); + inline void on_bind() + { + next_descriptor_set(); // Enqueue changes and update pointers + m_descriptor_set.on_bind(); // Notify async queue to flush any pending changes + } + template inline void notify_descriptor_slot_updated(u32 slot, const T& data) {