-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Vulkan implementation distinguish the user's render pass to its own created render pass in un-docked windows. #3459
Conversation
…created with the user's render-pass.
…kan the standard way. (#3459)
Hello, As pushed this PR seems to crashes both Vulkan examples, as main.cpp calls SetupVulkanWindow() which via (I would also recommend keeping the Thank you! |
Sorry about this. It's rooted in my state of confusion last night. I wasn't sure if a line was supposed to be there or not and did a force push. However it seems a bit of a conceptual twist. The example is calling |
Btw I'm not too fussy with small breakage in the Vulkan back-ends, people who use Vulkan tends to be quite knowledgable and flexible with those, as long as they are documented (e.g. nice asserts). |
I'd rather avoid doing a breakage because of the sdl_vulkan code. I don't know how I can test it. On the other hand, I am now hitting some issues related global variables. (global RenderPass, PipelineLayout etc...) |
I have pushed one more commit that restores the working demo. Hopefully it should not break any other code. It is more robust and allows to keep the call to |
Thank you @FunMiles. I have now merged this with various changes (actually replaced some of your added static with globals, made the changes work in |
Having add another look at this, it seems that there was dead code (unused shader modules), some leaks, and an extraneous pipeline was created for the main window in the example. I fixed those with 770c995 EDIT I broke things with this. See #6325 (comment) |
I had not used this last commit in my running code. However, having decided to upgrade the Vulkan version on my Mac, I was hit with several issues that made me come back. Not creating the pipeline each time caused me issues. So I want to revisit this in a clean way. The pipeline can be lazily created. However, the created pipeline can be shared with other windows. Is there an aversion to using shared_ptr ? Maybe this is a more general question linked with the lack of RAII in the code. If using a shared_ptr, the destructor should take care of destroying the pipeline. And, because of Vulkan's order of destruction requirements, it seems some other mechanism has to be implemented if some other objects on which the pipeline depends need to be destroyed earlier. |
There was indeed an issue, I regret not spotting it earlier. See resolution here: |
When a new window is created for a GUI component going out of the current window, a fresh render-pass is created that is not likely to be compatible with the user's render pass used when doing the GUI rendering in her/his window.
This PR addresses this issue by associating a pipeline with the created window that is compatible with the new render-pass.
Two more minor commits due to newer versions of Vulkan on Mac not liking the old validation layer. Also the CMake finding/linking with Vulkan is slightly updated to the more modern way.