I’m using Vulkan Scene Graph, a scene graph interface to Vulkan, to create an interactive viewer for a collection of single colored meshes. As part of my viewer, I want to create a “label” image, which will allow me to do picking and selection of meshes in O(1). My proof of concept (POC) application is working after I initially build my scene graph (setup the Vulkan pipelines and attachments). However, when I try to rebuild the write-to image attachment when my window is resized, the application subsequently does one of three things. 1) When trying to capture an image, the resulting image is fully transparent 2) The application gets stuck so that my entire Linux desktop is stuck for about half a minute 3) The validation layers output errors like the following:
info: offscreen render resized to: 1152x879
VUID-VkRenderPassBeginInfo-None-08996(ERROR / SPEC): msgNum: 1495210966 - Validation Error: [ VUID-VkRenderPassBeginInfo-None-08996 ] Object 0: handle = 0x2b3bf510, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x591f1bd6 | vkCmdBeginRenderPass(): pRenderPassBegin->renderArea.extent.width is zero.
The Vulkan spec states: If the pNext chain does not contain VkDeviceGroupRenderPassBeginInfo or its deviceRenderAreaCount member is equal to 0, renderArea.extent.width must be greater than 0 (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkRenderPassBeginInfo-None-08996)
Objects: 1
[0] 0x2b3bf510, type: 6, name: NULL
VUID-vkDestroyFramebuffer-framebuffer-00892(ERROR / SPEC): msgNum: -617577710 - Validation Error: [ VUID-vkDestroyFramebuffer-framebuffer-00892 ] | MessageID = 0xdb308312 | vkDestroyFramebuffer(): can't be called on VkFramebuffer 0xdcc8fd0000000012[] that is currently in use by VkCommandBuffer 0x3fd50810[]. The Vulkan spec states: All submitted commands that refer to framebuffer must have completed execution (https://vulkan.lunarg.com/doc/view/1.3.283.0/linux/1.3-extensions/vkspec.html#VUID-vkDestroyFramebuffer-framebuffer-00892)
What I don’t understand is why the error does not occur when replacing the image attachment, but only when trying to transfer the image from the GPU to the main memory.
I also don’t understand why the application works when I initially build the graph, but not when replacing the image texture. I’m building the pipelines and attachments exactly the same.
Another issue that may or may not be related, is that my application is running under Qt, so I’m not directly accessing the mainloop, but am periodically being called.
I realize that I don’t get sufficient detail here to reproduce the problem, and that my use of Vulkan Scene Graph adds another abstraction that make things less clear.
Would it help if I would trace all my Vulkan API calls and give a list of what exactly the application is doing?
Any tips of how to solve or debug this would be greatly appreciated!