VideoBackends:Vulkan: Associate descriptor pool with frame rather than command buffer

This commit is contained in:
Robin Kertels
2022-10-01 01:23:10 +02:00
parent ed75a58061
commit fba7d35f94
2 changed files with 17 additions and 14 deletions

View File

@ -43,11 +43,7 @@ public:
const CmdBufferResources& cmd_buffer_resources = m_command_buffers[m_current_cmd_buffer];
return cmd_buffer_resources.command_buffers[1];
}
VkDescriptorPool GetCurrentDescriptorPool() const
{
const CmdBufferResources& cmd_buffer_resources = m_command_buffers[m_current_cmd_buffer];
return cmd_buffer_resources.descriptor_pool;
}
VkDescriptorPool GetCurrentDescriptorPool() const { return m_descriptor_pools[m_current_frame]; }
// Allocates a descriptors set from the pool reserved for the current frame.
VkDescriptorSet AllocateDescriptorSet(VkDescriptorSetLayout set_layout);
@ -114,7 +110,6 @@ private:
// [0] - Init (upload) command buffer, [1] - draw command buffer
VkCommandPool command_pool = VK_NULL_HANDLE;
std::array<VkCommandBuffer, 2> command_buffers = {};
VkDescriptorPool descriptor_pool = VK_NULL_HANDLE;
VkFence fence = VK_NULL_HANDLE;
VkSemaphore semaphore = VK_NULL_HANDLE;
u64 fence_counter = 0;
@ -133,6 +128,7 @@ private:
u64 m_next_fence_counter = 1;
u64 m_completed_fence_counter = 0;
std::array<VkDescriptorPool, NUM_FRAMES_IN_FLIGHT> m_descriptor_pools;
std::array<CmdBufferResources, NUM_COMMAND_BUFFERS> m_command_buffers;
u32 m_current_frame = 0;
u32 m_current_cmd_buffer = 0;