April 2017
Intermediate to advanced
700 pages
21h 36m
English
The command pool is destroyed with the following code:
if( VK_NULL_HANDLE != command_pool ) {
vkDestroyCommandPool( logical_device, command_pool, nullptr );
command_pool = VK_NULL_HANDLE;
}
But, we can't destroy the pool until all command buffers allocated from it are not pending for execution on a device. To do that, we can wait on fences or use one of the functions that causes the application to wait until the selected queue stops processing commands, or while the whole device is busy (the work submitted to all queues from a given device is still being processed). Only then can we safely destroy the command pool.
Read now
Unlock full access