vk: Fix edge cases in descriptor update logic

This commit is contained in:
kd-11 2025-06-15 22:05:36 +03:00
parent 161e85eab7
commit 510c7f1afe
2 changed files with 9 additions and 3 deletions

View file

@ -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()

View file

@ -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 <typename T>
inline void notify_descriptor_slot_updated(u32 slot, const T& data)
{