Skip to content

Commit 8b67720

Browse files
Merge pull request #830 from Devsh-Graphics-Programming/ali_cmd
video: free command buffers when destroyed
2 parents 72bd107 + d8e5751 commit 8b67720

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

cmake/adjust/flags.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,6 @@ function(nbl_adjust_flags)
200200
list(APPEND _D_NBL_COMPILE_OPTIONS_ $<$<CONFIG:${NBL_MAP_CONFIGURATION_FROM}>:${NBL_TO_CONFIG_COMPILE_OPTIONS}>)
201201
endforeach()
202202

203-
set_directory_properties(PROPERTIES COMPILE_OPTIONS ${_D_NBL_COMPILE_OPTIONS_})
203+
set_directory_properties(PROPERTIES COMPILE_OPTIONS "${_D_NBL_COMPILE_OPTIONS_}")
204204
endif()
205205
endfunction()

src/nbl/video/CVulkanCommandBuffer.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ using namespace nbl;
99
using namespace nbl::video;
1010

1111

12+
nbl::video::CVulkanCommandBuffer::~CVulkanCommandBuffer()
13+
{
14+
const auto* vulkanDevice = static_cast<const CVulkanLogicalDevice*>(getOriginDevice());
15+
auto* vk = vulkanDevice->getFunctionTable();
16+
17+
const auto* vulkanCmdPool = IBackendObject::device_compatibility_cast<const CVulkanCommandPool*>(getPool(), getOriginDevice());
18+
assert(vulkanCmdPool);
19+
20+
vk->vk.vkFreeCommandBuffers(vulkanDevice->getInternalObject(), vulkanCmdPool->getInternalObject(), 1, &m_cmdbuf);
21+
out_of_order_dtor();
22+
}
23+
1224
const VolkDeviceTable& CVulkanCommandBuffer::getFunctionTable() const
1325
{
1426
return static_cast<const CVulkanLogicalDevice*>(getOriginDevice())->getFunctionTable()->vk;

src/nbl/video/CVulkanCommandBuffer.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,7 @@ class CVulkanCommandBuffer final : public IGPUCommandBuffer
270270
}
271271

272272
private:
273-
virtual ~CVulkanCommandBuffer() final
274-
{
275-
out_of_order_dtor();
276-
}
273+
~CVulkanCommandBuffer();
277274

278275
const VolkDeviceTable& getFunctionTable() const;
279276

0 commit comments

Comments
 (0)