-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Vulkan: Re-create main window pipeline (standalone) #8110
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
Vulkan: Re-create main window pipeline (standalone) #8110
Conversation
b303833
to
494807a
Compare
Sorry this is still too complex for me to follow. Can you:
|
e5008eb
to
25a7b6c
Compare
Hi, Sorry for the late response. Concerning your points:
I pushed changes according to your comments. I also did the same on the docking version #8111. |
- Added ImGui_ImplVulkan_ReCreateMainPipeline(...) to explicitly re-create the main window pipeline (when some of its properties are changed). - ImGui_ImplVulkan_ReCreateMainPipeline(...) does not implicitly use ImGui_ImplVulkan_InitInfo::PipelineRenderingCreateInfo, but a function parameter. - The main window pipeline is created only if possible during ImGui_ImplVulkan_Init(...) (if a render pass or rendering info are given), else it should be created with ImGui_ImplVulkan_ReCreateMainPipeline(...) - ImGui_ImplVulkan_CreatePipeline now takes a struct rather than (too) many parameters (and returns the created pipeline).
25a7b6c
to
d943f36
Compare
Thanks for your update! Minor stuff:
If they are the only changes and if it's much work for you to rebase/push both branches don't worry I can apply those changes myself. I agree in principle with [7] [8] but there are very few call sites to [7] and adding structs to the .h increases perceived complexity. For [8] it is all internal and is technically and unrelated refactor. I am undecided but I might rework this a little bit. I admit I am a little bit puzzled by your main reason for this [1], sure it is in theory overkill but you do have any data suggesting it is a meaningful performance problem? |
Please don't make new edits right now because I'm working on this on my side, but I have a question: in if (info.pDynamicRendering)
{
v->PipelineRenderingCreateInfo = *info.pDynamicRendering;
} Which seems a bit ambiguous, afaik the value is not used after _Init by other functions, but it seems generally sensible/sane to set this. But then if we set it (why not) then the equivalent parameter in |
Question 2: We have: VkPipelineRenderingCreateInfoKHR ImGui_ImplVulkan_InitInfo::PipelineRenderingCreateInfo vs const VkPipelineRenderingCreateInfoKHR* ImGui_ImplVulkan_MainPipelineCreateInfo::pDynamicRendering For essentially the same thing. Name and storage are inconsistent and something could be changed. For consistency wouldn't it make sense to make the one in the new structure exactly the same as the one in the InitInfo struct, aka not a pointer, and rely on Supposedly we don't allow toggling |
I don't have more changes in mind (for now). I'll let you dot the changes you suggested when merging. I would also suggest adding comments to explain the new behaviour
Concerning |
It is necessary to keep |
I'm not sure I understand this part of the answer, the later should be written into the earlier. |
Yes, for the main window pipeline eclusively during You can rename |
(1) But does it even need to a pointer? Please re-read my question. It could use same mechanism as (2) Additionally, for consistency and toward being able to configure how secondary viewport pipeline is created, I wonder if we should, in theory, later:
|
(1) Sorry I didn't understand it the way you meant. No it does not need to be a pointer, I just thought it made more sense since it is optional. I agree it is preferable to use the same logic everywhere. |
(2) I did not change |
(2) The assume the PipelineCreateInfo you added in the .cpp file to avoid using arguments, but I was thinking a PipelineCreateInfo dedicated to those 4 fields + ones potentially introduced by e.g. SuperRonan@5b9a62f I'll finish the current thing for you to review first. |
Yes, the next step would be to add something like 5b9a62f. |
Could you review the This is based on
Before merging I would like us to investigate the following "upcoming" changes:
Based on the general intent, but it make sense in order to move forward to rework the |
LGTM. One thing was missing: deep copy of the And concerning the deep copy of the |
Here is the commit on my fork branch: 2f10f9e |
I also added a fix: 8f62407 |
Err I don't think your linked change makes any difference - it's the same code - and i don't understand how it relates to the linke compile error? |
a
|
My bad, fixing here. |
…#8111, #8053) - Added ImGui_ImplVulkan_CreateMainPipeline(...) to explicitly re-create the main window pipeline (when some of its properties are changed). - Does not implicitly use ImGui_ImplVulkan_InitInfo::PipelineRenderingCreateInfo, but a function parameter. - The main window pipeline is created only if possible during ImGui_ImplVulkan_Init(...) (if a render pass or rendering info are given), else it should be created with ImGui_ImplVulkan_ReCreateMainPipeline(...) - ImGui_ImplVulkan_CreatePipeline now takes a struct rather than (too) many parameters (and returns the created pipeline).
This should now be all merged in both branches! Thanks. For the deep-copy I ended up doing this: 026d47c : using an ImVector<> and doing it in |
I'm closing this now, thanks!
Yes but it's also trivial to comment which are used. We'll see how things go when we move toward those features. |
I have pushed a couple of rework of the Vulkan backend related to the things discussed here.
Would you be able to update and confirm that everything works well for you? |
Thanks! |
@ocornut I found a few issues with multi-viewports. I will makes changes and submit a new PR to submit a the fix.
Nice! In the end that's probably the best solution to fix the color space issues. |
This is a standalone PR (from #8053, solve one problem at the time) to just recreate the main window pipeline when one of its properties changes (RenderPass / pDynamicRendering, MSAASamples, ...), but without any color correction (the colors might look off depending on the render target format / swapchain color space if directly forwarded to be presented).
A docking version is comming soon (without color correction).
API changes: