mirror of
https://github.com/simple64/simple64.git
synced 2026-09-07 12:52:44 +02:00
update parallel rdp
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user