@@ -451,6 +451,8 @@ namespace bs { namespace ct
VulkanCommandBuffer(VulkanDevice& device, GpuQueueType type, UINT32 deviceIdx, UINT32 queueIdx,
bool secondary);
+ ~VulkanCommandBuffer();
+
/**
* Tasks the command buffer to find a new internal command buffer. Call this after the command buffer has been
* submitted to a queue (it's not allowed to be used until the queue is done with it).
@@ -657,9 +657,6 @@ namespace bs { namespace ct
void VulkanCmdBuffer::reset()
{
- if (mState != State::Submitted)
- return;
-
mState = State::Ready;
vkResetCommandBuffer(mCmdBuffer, VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT); // Note: Maybe better not to release resources?
@@ -1678,6 +1675,11 @@ namespace bs { namespace ct
acquireNewBuffer();
}
+ VulkanCommandBuffer::~VulkanCommandBuffer()
+ {
+ mBuffer->reset();
+ }
void VulkanCommandBuffer::acquireNewBuffer()
VulkanCmdBufferPool& pool = mDevice.getCmdBufferPool();