rsx: Simplify descriptor set contract a bit

- Making the functions sometimes destructive is confusing
This commit is contained in:
kd-11 2025-08-03 16:01:17 +03:00 committed by kd-11
parent c347435151
commit 315ffed12f
2 changed files with 4 additions and 19 deletions

View file

@ -404,30 +404,15 @@ namespace vk
vkUpdateDescriptorSets(*g_render_device, 1, &writer, 0, nullptr); vkUpdateDescriptorSets(*g_render_device, 1, &writer, 0, nullptr);
} }
void descriptor_set::push(rsx::simple_array<VkCopyDescriptorSet>& copy_cmd, u32 type_mask) void descriptor_set::push(const rsx::simple_array<VkCopyDescriptorSet>& copy_cmd, u32 type_mask)
{ {
m_push_type_mask |= type_mask; m_push_type_mask |= type_mask;
if (m_pending_copies.empty()) [[likely]]
{
m_pending_copies = std::move(copy_cmd);
return;
}
m_pending_copies += copy_cmd; m_pending_copies += copy_cmd;
} }
void descriptor_set::push(rsx::simple_array<VkWriteDescriptorSet>& write_cmds, u32 type_mask) void descriptor_set::push(const rsx::simple_array<VkWriteDescriptorSet>& write_cmds, u32 type_mask)
{ {
m_push_type_mask |= type_mask; m_push_type_mask |= type_mask;
#if !defined(__clang__) || (__clang_major__ >= 16)
if (m_pending_writes.empty()) [[unlikely]]
{
m_pending_writes = std::move(write_cmds);
return;
}
#endif
m_pending_writes += write_cmds; m_pending_writes += write_cmds;
} }

View file

@ -102,8 +102,8 @@ namespace vk
void push(const VkDescriptorBufferInfo& buffer_info, VkDescriptorType type, u32 binding); void push(const VkDescriptorBufferInfo& buffer_info, VkDescriptorType type, u32 binding);
void push(const VkDescriptorImageInfo& image_info, VkDescriptorType type, u32 binding); void push(const VkDescriptorImageInfo& image_info, VkDescriptorType type, u32 binding);
void push(const VkDescriptorImageInfo* image_info, u32 count, VkDescriptorType type, u32 binding); void push(const VkDescriptorImageInfo* image_info, u32 count, VkDescriptorType type, u32 binding);
void push(rsx::simple_array<VkCopyDescriptorSet>& copy_cmd, u32 type_mask = umax); void push(const rsx::simple_array<VkCopyDescriptorSet>& copy_cmd, u32 type_mask = umax);
void push(rsx::simple_array<VkWriteDescriptorSet>& write_cmds, u32 type_mask = umax); void push(const rsx::simple_array<VkWriteDescriptorSet>& write_cmds, u32 type_mask = umax);
void push(const descriptor_set_dynamic_offset_t& offset); void push(const descriptor_set_dynamic_offset_t& offset);
void on_bind(); void on_bind();