vkDestroyBuffer-buffer-00922 validation error

Hello,

I am working on Sascha’s sample ‘trianglevulkan13’
where it uses MAX_CONCURRENT_FRAMES = 2
In this program, I imported texture resources so I modified the function createDescriptors()

Then, this program runs very all right
except one validation error message as follows

ERROR: [-464217071][VUID-vkDestroyBuffer-buffer-00922] : Validation Error: [ VUID-vkDestroyBuffer-buffer-00922 ] | MessageID = 0xe4549c11 | vkDestroyBuffer(): can’t be called on VkBuffer 0x44d3470000000213 that is currently in use by VkCommandBuffer 0x1ba064516f0.
The Vulkan spec states: All submitted commands that refer to buffer, either directly or via a VkBufferView, must have completed execution (Vulkan® 1.3.296 - A Specification (with all registered extensions))

The program does not crash and exits all right when I click the termination button on the title bar

So may I ignore this error message ?

Or
How can I remove this validation error message ?

Thank you

That message is pretty clear. You try to destroy a buffer that is still in use. To avoid this you need to wait for the command buffer using it (that buffer) to finish before destroying said buffer. You can do that with a fence, or if this is at program termination, you can use one of the heavier wait functions like vkDevice/vkQueueWaitIdle to make sure all work has executed before you try to destroy that buffer.

1 Like

Hello, Sascha
Thank you for your valuable advise
vkQueueWaitIdle may help this issue, which I didn’t know
I will try to fix this validation error after I study fences, semaphores soon
Have a great year-end season and see you, Sascha