Progress Pics
I have managed to get triangle rendering in Dear ImGui.
Resources
- ImGui Vulkan + SDL example
- Sascha Willems Vulkan samples
- Vulkan Programming Guide
- API Without Secrets
- Khronos
Notes
I’m going pretty slow and looking up pretty much every function and struct. It takes a lot of code, and there are a lot of concepts to build up a mental model for. Pipelines, render passes, attachments, queues etc. There’s a lot.
To get the triangle inside an ImGui window, I have to render the tri offscreen and submit it as an image. ImGui also needs a render pass. For now I have two renderpasses but maybe there is a way to do it (offscreen + ImGui) in one pass with multiple subpasses.
One thing that is a bit wonky (well, not really but I had to learn it) is that ImGui rendering needs it’s own command buffers because part of the multiview setup is that it will create a window, and that process destroys some buffers. So if for example I had already recorded some commands for my offscreen pass, the command buffers may get destroyed by the ImGui backend before my recorded commands are executed.
To accomodate that, my offscreen pass has separate command buffers, command pool etc. But one thing I had to do with this setup is that I am calling VkSubmitQueue twice. I’m not sure if that’s a good idea, or if calling VkSubmitQueue multiple times is expected. Another that I am concered about is that I have no synchronization between my offscreen pass and my ImGui pass (other than they both submit to the same queue). Not sure what the ramifications of that is yet, I’m sure I’ll find out as get more features added in.
>> Home