1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-21 18:22:33 +01:00

vk: Avoid leaking descriptor copies

This commit is contained in:
kd-11 2022-01-20 00:04:40 +03:00 committed by kd-11
parent 2331dc3256
commit 3942a464fe
3 changed files with 5 additions and 2 deletions

View File

@ -829,6 +829,7 @@ void VKGSRender::emit_geometry(u32 sub_index)
{
// Need to update descriptors; make a copy for the next draw
VkDescriptorSet previous_set = m_current_frame->descriptor_set.value();
m_current_frame->descriptor_set.flush();
m_current_frame->descriptor_set = allocate_descriptor_set();
rsx::simple_array<VkCopyDescriptorSet> copy_cmds(binding_table.total_descriptor_bindings);

View File

@ -346,8 +346,10 @@ namespace vk
vkUpdateDescriptorSets(*g_render_device, 1, &writer, 0, nullptr);
}
void descriptor_set::push(rsx::simple_array<VkCopyDescriptorSet>& copy_cmd)
void descriptor_set::push(rsx::simple_array<VkCopyDescriptorSet>& copy_cmd, u32 type_mask)
{
m_push_type_mask |= type_mask;
if (m_pending_copies.empty()) [[likely]]
{
m_pending_copies = std::move(copy_cmd);

View File

@ -65,7 +65,7 @@ namespace vk
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, u32 count, VkDescriptorType type, u32 binding);
void push(rsx::simple_array<VkCopyDescriptorSet>& copy_cmd);
void push(rsx::simple_array<VkCopyDescriptorSet>& copy_cmd, u32 type_mask = umax);
void bind(VkCommandBuffer cmd, VkPipelineBindPoint bind_point, VkPipelineLayout layout);
void bind(const command_buffer& cmd, VkPipelineBindPoint bind_point, VkPipelineLayout layout);