I’m currently attempting to get mouse picking functional in my work project by rendering the scene to my usual swapchain command buffers and framebuffers first, then returning to performing a second renderpass that outputs a dummy color value to the color attachment output at 0 (apparently req’d for validation reasons), and outputting a uvec2 containing information about the currently rendered primitive to attachment 1.
The first frame appears to run fine: starting at the second frame, though, I begin receiving VK_ERROR_DEVICE_LOST errors from vkQueueSubmit and vkWaitForFences, followed by warnings about resetting a command buffer or fence that is still in use.
The following gist contains important sections of my code, with new gist “files” for each method: https://gist.github.com/fuchstraumer/57d6057dd4eb4883d0dd46f7f8c92e1b
If more information would help, let me know. The rest of the base scene class can be found here:
And my offscreen framebuffers class can be found here:
The code specific to this project, though, is for a private research contract with a US govt research institution so I have to be careful about what I share. Sharing our rendering frontend in full shouldn’t be a problem, but I’ll have to double check first.
Any assistance would be grandly appreciated. There’s a good chance I’m just doing something horrifyingly incorrect, though. I’m using a K1200 and the latest beta Vulkan drivers, as well. Previously I was getting a Kernel error, code 3 subcode 7. Now I just get VK_ERROR_DEVICE_LOST, but at least its not a hard crash anymore.
edit: Grabbing the first frame in renderdoc before it crashes, it appears the second queue submit command never shows? The first frame shows all the queue submissions from when I’m uploading resources and data, though, so I’m not sure why it’d not show the offscreen submission.
second edit: Submitting from a different queue for the extra commands still results in the error, re-ordering the commands so that extra came first makes the error happen for the presentation queue, and pooling all the submits together into one vkQueueSubmit call results in the wrong image being used in the swapchain (and the error occurring on frame 2)