-
-
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
Backends: Vulkan: Create a custom pipeline for viewports #6325
Conversation
The main render pass may have a different configuration than the viewport window render pass. Vulkan can reuse the pipeline between different render passes only if the render pass configuration is the same. To fix it, when it's time to RenderDrawData for the viewport window and a pipeline is not yet available, a new pipeline is created for that window to be sure that is compatible with the render pass.
… destroyed During window resize the pipeline is destroyed but non correctly reset to nullptr. So if reused it cause a memory error.
Hello,
|
I created a commit into a different branch: skaman@f974caa Is it ok? I created a custom render pass that i pass to the ImGui_ImplVulkan_Init function. To reproduce the issue the render pass should differ from the internal one, so i changed the color format from UNORM to SRGB (the colors are weird but it's just for test). In the real world probably the user have a depth buffer or multiple render passes.
Yes you're right. I'll change the fix to have a shared pipeline for all secondary windows. I'll let you know when it's done. |
Create a shared pipeline for all the secondary windows (they always have the same configuration for their render passes). The pipeline is created only once when the first window is created.
Ok, committed the shared pipeline. Now there's only one pipeline for all the secondary windows. |
Is this being merged? I'm experiencing an issue that would be solved with this. Particularly the RenderPass I'm using in I could see this as a solution, or some way to request a custom surface format when creating the multi-viewport renderpass. |
Any update on this? |
Thank you @skaman and sorry for slow answer. Why is the |
I realized that:
Therefore the whole thing is a fishy leftover that once worked. Initially was added in 41e2aa2 for #3459. However it was immediately removed by e8447de also for #3459 and I believe I messed up there. @FunMiles themselves updated later and eventually reacted to it #3459 (comment) but I guess it went unnoticed then :( While it seems to be my fault I believe it highlight that I need clear repros of the more intricate use cases of Vulkan. (I maintain them in private branches and could probably aim to publish them somewhere). Thanks for providing one here! |
The PR is incorrect as is, as I have moved the creation in Apologies @FunMiles ! Thanks all! |
The main render pass may have a different configuration than the viewport window render pass. Vulkan can reuse the pipeline between different render passes only if the render pass configuration is the same. To fix it, when it's time to RenderDrawData for the viewport window and a pipeline is not yet available, a new pipeline is created for that window to be sure that is compatible with the render pass.
This is related to the issue #6305