Skip to content

Commit f81a27e

Browse files
committed
Added use of VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT
1 parent f9b63f0 commit f81a27e

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/vsg/app/CommandGraph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void CommandGraph::record(ref_ptr<RecordedCommandBuffers> recordedCommandBuffers
103103
}
104104
if (!commandBuffer)
105105
{
106-
ref_ptr<CommandPool> cp = CommandPool::create(device, queueFamily);
106+
ref_ptr<CommandPool> cp = CommandPool::create(device, queueFamily, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT);
107107
commandBuffer = cp->allocate(level());
108108
_commandBuffers.push_back(commandBuffer);
109109
}

src/vsg/app/SecondaryCommandGraph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void SecondaryCommandGraph::record(ref_ptr<RecordedCommandBuffers> recordedComma
100100
}
101101
if (!commandBuffer)
102102
{
103-
ref_ptr<CommandPool> cp = CommandPool::create(device, queueFamily);
103+
ref_ptr<CommandPool> cp = CommandPool::create(device, queueFamily, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT);
104104
commandBuffer = cp->allocate(level());
105105
_commandBuffers.push_back(commandBuffer);
106106
}

src/vsg/app/TransferTask.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ TransferTask::TransferResult TransferTask::_transferData(DataToCopy& dataToCopy)
444444

445445
if (!commandBuffer)
446446
{
447-
auto cp = CommandPool::create(device, transferQueue->queueFamilyIndex());
447+
auto cp = CommandPool::create(device, transferQueue->queueFamilyIndex(), VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT);
448448
commandBuffer = cp->allocate(VK_COMMAND_BUFFER_LEVEL_PRIMARY);
449449
}
450450
else

src/vsg/vk/CommandBuffer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ void CommandBuffer::reset(VkCommandBufferResetFlags flags)
4747
_currentPipelineLayout = VK_NULL_HANDLE;
4848
_currentPushConstantStageFlags = 0;
4949

50-
vkResetCommandBuffer(_commandBuffer, flags);
50+
if ((_commandPool->flags & VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT) != 0)
51+
{
52+
vkResetCommandBuffer(_commandBuffer, flags);
53+
}
5154
}
5255

5356
void CommandBuffer::setCurrentPipelineLayout(const PipelineLayout* pipelineLayout)

0 commit comments

Comments
 (0)