I use this Vulkan under QML approach to integrate Vulkan with QtQuick. But I noticed that the depth test is disabled (the model that was rendered later overlaps the first model even if it is behind). But in this method, renderpass and framebuffer are already created and I can't modify their creation. Please tell me if there is any way to enable depth test in this case?
1 Answer
In the example you're referring to, the Vulkan code in this file controls all the actual Vulkan rendering logic. It creates its own renderpass and framebuffers and sets up the depth settings for the pipeline here.
If you're saying that in your particular use case you can't modify the renderpass or framebuffers you still have a path. You'd need to create your own offscreen render target with its own depth and color attachments, render all you want to that, and then finally when you're done, blit that to the actual color attachments used with the top level renderpass.