update parallel rdp

This commit is contained in:
Logan McNaughton
2021-08-09 15:51:33 -06:00
parent 6705d5e44e
commit 19445a0df4
62 changed files with 110819 additions and 53611 deletions
@@ -31,7 +31,8 @@ CommandPool::CommandPool(Device *device_, uint32_t queue_family_index)
VkCommandPoolCreateInfo info = { VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO };
info.flags = VK_COMMAND_POOL_CREATE_TRANSIENT_BIT;
info.queueFamilyIndex = queue_family_index;
table->vkCreateCommandPool(device->get_device(), &info, nullptr, &pool);
if (queue_family_index != VK_QUEUE_FAMILY_IGNORED)
table->vkCreateCommandPool(device->get_device(), &info, nullptr, &pool);
}
CommandPool::CommandPool(CommandPool &&other) noexcept
@@ -86,6 +87,8 @@ void CommandPool::signal_submitted(VkCommandBuffer cmd)
VkCommandBuffer CommandPool::request_secondary_command_buffer()
{
VK_ASSERT(pool != VK_NULL_HANDLE);
if (secondary_index < secondary_buffers.size())
{
auto ret = secondary_buffers[secondary_index++];
@@ -116,6 +119,8 @@ VkCommandBuffer CommandPool::request_secondary_command_buffer()
VkCommandBuffer CommandPool::request_command_buffer()
{
VK_ASSERT(pool != VK_NULL_HANDLE);
if (index < buffers.size())
{
auto ret = buffers[index++];
@@ -146,6 +151,9 @@ VkCommandBuffer CommandPool::request_command_buffer()
void CommandPool::begin()
{
if (pool == VK_NULL_HANDLE)
return;
#ifdef VULKAN_DEBUG
VK_ASSERT(in_flight.empty());
#endif
@@ -157,6 +165,9 @@ void CommandPool::begin()
void CommandPool::trim()
{
if (pool == VK_NULL_HANDLE)
return;
table->vkResetCommandPool(device->get_device(), pool, VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT);
if (!buffers.empty())
table->vkFreeCommandBuffers(device->get_device(), pool, buffers.size(), buffers.data());