-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Vulkan: Re-create main window pipeline (standalone) with docking #8111
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) with docking #8111
Conversation
|
As per my comment in #8085 (comment)
I use this process of reviewing and sculpting history all the time myself. Never committing random bunch of changes bundled together. When there are too many shallow changes needed (e.g. realignement, moving blocks, renaming something) for a larger feature which is it harder to review, I try to sculpt history to move the shallow change to a first commit, then the feature as a second commit, so both are individual easier to review than both together. Sorry this is tedious but you'll quickly learn how to make neat PR, it'll be nicer both for you and for any of your future contribution to open source. As stated in my recent 10 years of dear imgui post, I don't have mental capacity to review bundled changes and Vulkan is particular difficult for me as I'm not a user. Thank you! |
2e123d8 to
7a50853
Compare
|
I squashed #8110 and #8111 down to one commit each. |
If the PR has xx commits expected for master and then subsequent commits expected for docking, I can cherry-pick them individually. It's actually easier both for you and me in the end. If the xx commits expected for master then written over docking would create a conflict on master it's a little trickier, but happy to resolve minor/obvious conflict on cherry-pick. Please generally review my comments. Otherwise I'll catch up anyhow later, but I tend to get sidetracked too easily when I spot a mistake or unnecessary change in a PR. |
I did see that, but I still though it would be easier for you since the merge was not automatic, but if it is less of a issue for you than having two PR, I'll keep working on docking. |
|
I also have some other changes (SuperRonan/imgui@5b9a62f) ready to be pushed (ability to control viewports format / present mode, but without color correction), so this might be considered a new feature. The same commit also fixes a bug in the vulkan impl: |
| pci.PipelineCache = VK_NULL_HANDLE; | ||
| pci.RenderPass = wd->RenderPass; | ||
| pci.Subpass = 0; | ||
| pci.MSAASamples = VK_SAMPLE_COUNT_1_BIT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be clean to use a PCI factory so you can one shot this pci struct with something like PCISettings.createBaseVulkanPCI()
| if (wd->UseDynamicRendering) | ||
| { | ||
| rendering_info.sType = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO; | ||
| rendering_info.pNext = nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same thing with render_info. Surely there is some cross impl pattern in the data structure that make it worth creating a factory.
7a50853 to
3896adf
Compare
…k_re_create_pipeline_2
3896adf to
532717e
Compare
|
The docking version of the commit has this block missing from {
bool create_pipeline = false;
const ImGui_ImplVulkan_PipelineRenderingCreateInfo * p_dynamic_rendering = nullptr;
if (v->RenderPass)
{
create_pipeline = true;
}
else
{
#ifdef IMGUI_IMPL_VULKAN_HAS_DYNAMIC_RENDERING
if (v->UseDynamicRendering && v->PipelineRenderingCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR)
{
p_dynamic_rendering = &v->PipelineRenderingCreateInfo;
create_pipeline = true;
}
#endif
}
if (create_pipeline)
{
ImGui_ImplVulkan_MainPipelineCreateInfo mp_info = {};
mp_info.RenderPass = v->RenderPass;
mp_info.Subpass = v->Subpass;
mp_info.MSAASamples = info->MSAASamples;
mp_info.pDynamicRendering = p_dynamic_rendering;
ImGui_ImplVulkan_ReCreateMainPipeline(mp_info);
}
}Is that a mistake? |
|
It was moved to |
|
Oh yes indeed the block is also in |
…#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).
|
Closing as solved as per discussion and commits in #8110 |
Extension of #8110 to the docking branch (the merge is nearly straightforward, but not totally).
To keep one PR = one feature, I will soon push another branch (and PR) to give the application the control over the viewports surface format (and some bug fixes I found) (much like #8061, but without the whole color correction stuff).