Skip to content

#5037 for docking branch: Support for dynamic_rendering #5446

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

Closed
wants to merge 2 commits into from

Conversation

spnda
Copy link
Contributor

@spnda spnda commented Jul 2, 2022

Version of #5037 for docking branch as requested by #5037 (comment). Sorry for the delay, completely forgot about my original PR.

As we now load function pointers manually, it's possible for vkCmdBeginRenderingKHR and vkCmdEndRenderingKHR to be nullptr. Is it fine to just cause a segfault in ImGui_ImplVulkan_RenderWindow when UseDynamicRendering is enabled but the extension wasn't enabled on the device and the function pointers therefore possibly be nullptr?

@spnda spnda changed the title Docking dynamic rendering #5037 for docking branch: Support for dynamic_rendering Jul 2, 2022
@spnda
Copy link
Contributor Author

spnda commented Jul 4, 2022

Oh and I would also like to extend my comment about the function pointers: As they're from an extension and not part of core, the way it's currently setup will result in linker issues if VK_NO_PROTOTYPES is not defined. I couldn't find any manual function pointer loading in regards to the other functions from the KHR_swapchain and KHR_surface extensions. So what is the recommended way to do this in the already present backend, if it's not something totally new?

@ocornut
Copy link
Owner

ocornut commented Oct 25, 2022

Hello,

Is it fine to just cause a segfault in ImGui_ImplVulkan_RenderWindow when UseDynamicRendering is enabled but the extension wasn't enabled on the device and the function pointers therefore possibly be nullptr?

Best to assert if possible.

the way it's currently setup will result in linker issues if VK_NO_PROTOTYPES is not defined.

I am not sure I follow, are you suggesting the PR things won't link by default, making this unmergeable as-is ?

So what is the recommended way to do this in the already present backend, if it's not something totally new?

I have no idea, I'm not so familiar with Vulkan ecosystem.

@spnda
Copy link
Contributor Author

spnda commented Oct 25, 2022

I am not sure I follow, are you suggesting the PR things won't link by default, making this unmergeable as-is ?

I have no idea, I'm not so familiar with Vulkan ecosystem.

With Vulkan one has 2 options:

  • You can link against the Vulkan loader (vulkan-1.lib on Windows) which contains method stubs for every core Vulkan function and some essential functions from extensions like VK_KHR_swapchain and VK_KHR_surface. As dynamic rendering is an extension (before 1.3), we will require the user to have a Vulkan lib that is up to date if we link against the library. This only happens when VK_NO_PROTOTYPES is not defined.
  • You cannot link against the function prototypes with VK_NO_PROTOTYPES defined, forcing you to have to load the function pointers at runtime. In my opinion, this is the best way to do things, as it decreases link time and overall reduces runtime speeds because of less indirection. However, this only happens when you define IMGUI_IMPL_VULKAN_NO_PROTOTYPES when building ImGui which a lot of users probably don't do.

The PR works in its current state, assuming that the user has a fairly recent version of the Vulkan loader to link against. With older versions, the user would need to define IMGUI_IMPL_VULKAN_NO_PROTOTYPES so that ImGui loads the function pointers at runtime. Otherwise, there will be link failures with vkCmdBeginRenderingKHR and vkCmdEndRenderingKHR with older versions of the Vulkan loader lib. This happens no matter if the user chooses to use dynamic rendering or not.

I hope what I said clarifies how this works. So, we can either leave this as is and just tell users to upgrade to a new Vulkan SDK that ships with the most up to date Vulkan loader, or we have to choose another solution. My suggestion would be to have a struct which the user has to pass to the Vulkan backend which contains function pointers to all the function the backend will have to use. This avoids the problem completely, as the backend is not responsible for anything related to the function loading. Or we just go the simplest route and unconditionally load the two offending functions at runtime, no matter if the rest is also loaded at runtime or statically linked. However, I feel like such a change is out of the scope of this PR.

@misyltoad
Copy link

Any movement on this? Would be nice to have.

@cmarcelo
Copy link

cmarcelo commented Jun 8, 2023

@spnda @ocornut

Suggestion to move forward with this, based on the previous comments:

  • For this PR, we always load vkCmdBeginRenderingKHR and vkCmdEndRenderingKHR at runtime as Sean suggested. Because this will be used with and without prototypes, we'll have to store them in different names to avoid conflict.

  • For another PR, consider changing so the backend implementation to always load functions, i.e. always compiled with VK_NO_PROTOTYPES. If the user doesn't set the loader function, we use the default one from the loader (we can provide our own prototype for what's needed here). This would allow us to get rid of the IMGUI_IMPL_VULKAN_NO_PROTOTYPES. At this point we can use the regular names for the two functions of this PR. The reasoning here is that always loading is not significantly worse, and possibly better (because skips the trampoline).

If @spnda don't plan to further work on this, I'm happy to update the PR (or make another one cherry-picking these changes).

@spnda
Copy link
Contributor Author

spnda commented Jun 8, 2023

@cmarcelo I am still invested and effectively still waiting on a response from @ocornut. If I don't hear back within a few days I will just load the pointers at runtime no matter what, making this work 100%. So any users can checkout my fork to use these features if desired. And I like your idea of a separate PR to always use dynamic dispatch, so we (or you) could look into that.

@ocornut
Copy link
Owner

ocornut commented Jun 8, 2023

Hello,
Your October post seemingly pointed at no solution so I wasn't sure how to answer.

  • I'm absolutely fine moving toward a backend that always load functions if this the first step to better solution. I'm happy to first merge a change doing that. I didn't know it was possible without user providing a loader function, but your sentence "If the user doesn't set the loader function, we use the default one from the loader (we can provide our own prototype for what's needed here)." suggest so.
  • But I'm not entirely sure how to implement that considering VK_NO_PROTOTYPES would leak into imgui_impl_vulkan.h and potentially affect user application which may want to use regular prototypes. As a test-bed the examples's main.cpp file shouldn't be affected and should be able to use the stubs if they want to.
  • Ideally: we would need to cater for unity/jumbo build with the possibility of user including imgui_impl_vulkan.cpp in the middle of their code. Which may involve using unique function names, aka using the IMGUI_VULKAN_FUNC_MAP macro to generate uniquely named symbols + redirecting calls in imgui_impl_vulkan.cpp to those names + undoing the redirect at the end of the file. This shouldn't be too difficult.

I would suggest making the always-load-function-pointer in 1 commit, then changes related to dynamic_rendering in a second commit, and force-push the result into this branch. I will cherry-pick the first one into both branches before merging second one.

Optionally/ideally we would need for reference a third commit that demonstrate using dynamic-rendering in one of the examples's main.cpp. I won't merge this one but I would need it as reference and for testing.

@cmarcelo
Copy link

cmarcelo commented Jun 9, 2023

@spnda Good to hear you are still invested, I'll focus on the loading part then.

I said earlier "This would allow us to get rid of the IMGUI_IMPL_VULKAN_NO_PROTOTYPES." but looking deeper here, we can't, we need it to control whether we can access the vkGetInstanceProcAddr() "directly" (i.e. expect the linker to plug it for us). We could avoid it if we manually dlsym (or Windows equivalent).

macro to generate uniquely named symbols + redirecting calls in imgui_impl_vulkan.cpp to those names + undoing the redirect at the end of the file

@ocornut The undoing part here is the tricky one. The default solution would be #define all symbols we use to the unique names and later #undef them, but in both cases we can't use the FUNC_MAP macro to achieve that (can't define/undef inside a macro itself) -- would have to provide the defines on top and undefs on bottom of the file. Did you had something more specific in mind for the undoing?

We could side-step both this and the "don't leak VK_NO_PROTOTYPES" by storing the functions we care about in a global static, and access them via such global or maybe even a macro (that we can undef later). So something like g_vulkan.vkCmd...(...), g_vk.Cmd...(...), API(vkCmd...)(...), etc. Nothing of this would be visible from the user of the backend.cpp code. Would that be an acceptable option?

@cmarcelo
Copy link

cmarcelo commented Jun 9, 2023

Update: I've implemented the API() approach and didn't liked it, so I've tried something different: put the whole implementation inside a namespace. The function pointers can have the regular names, and the backend functions will use those instead of the ones in global namespace. This works, the downside is having to "bridge" the calls to inside the namespace, e.g.

// In the imgui_impl_vulkan.cpp file
bool                 ImGui_ImplVulkan_Init(ImGui_ImplVulkan_InitInfo* info, VkRenderPass render_pass) { return imgui_impl_vulkan::ImGui_ImplVulkan_Init(info, render_pass); }

Here are the two attempts so you can compare:

I've only ported GLFW example for this comparison. Why the example changed? I needed all the "entrypoint" functions to pass the Instance, so we can load the pointers. Since those are "internal" it won't cause a break.

Given all the options I considered in this and previous comment, my favorite solution so far is the namespace one.

@ocornut
Copy link
Owner

ocornut commented Jun 9, 2023

If the initial suggestion of just loading those 2 functions with a specific name is easier we can consider it.

I would also consider requiring users to update VulkanSDK if this simplifies our problem meaningfully.

@cmarcelo
Copy link

cmarcelo commented Jun 9, 2023

If the initial suggestion of just loading those 2 functions with a specific name is easier we can consider it.

I expect it to be easier because we can store the pointers in a struct and just live with that for the two calls -- no worries about make it extremely convenient to access. My understanding is @spnda will update this PR to achieve that.

@spnda
Copy link
Contributor Author

spnda commented Jun 9, 2023

I would suggest making the always-load-function-pointer in 1 commit, then changes related to dynamic_rendering in a second commit, and force-push the result into this branch. I will cherry-pick the first one into both branches before merging second one.

I thought that within this PR I will merely load the two new function pointers to make this work. Then @cmarcelo will "clean it up" later by loading loading everything or making it more dynamic to fix issues like these.

Though I think I would currently just change the original commit to reflect these changes.

I expect it to be easier because we can store the pointers in a struct and just live with that for the two calls -- no worries about make it extremely convenient to access.

My mockup currently just adds imgui_vkCmdBeginRenderingKHR and imgui_vkCmdEndRenderingKHR as global pointers for that to work with and without prototypes. The following commit will fix all of the issues by always loading those two functions, regardless of VK_NO_PROTOTYPES, meaning that this PR should be good to go.

@spnda spnda force-pushed the docking_dynamic_rendering branch from dc3250b to 76c602b Compare June 9, 2023 13:09
Comment on lines 1051 to 1078
#else
IM_UNUSED(loader_func);
IM_UNUSED(user_data);
#endif

imgui_vkCmdBeginRenderingKHR = reinterpret_cast<PFN_vkCmdBeginRenderingKHR>(loader_func("vkCmdBeginRenderingKHR", user_data));
imgui_vkCmdEndRenderingKHR = reinterpret_cast<PFN_vkCmdEndRenderingKHR>(loader_func("vkCmdEndRenderingKHR", user_data));

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way the user is required to call ImGui_ImplVulkan_LoadFunctions() even in the case it wouldn't call it otherwise (i.e. when linking with Vulkan and using prototypes).

For the no VK_NO_PROTOTYPES case I suggest you delay initializing those to ImGui_ImplVulkan_Init() and either use vkGetInstanceProcAddr() directly there (preferred in this case) or set things up to call ImGui_ImplVulkan_LoadFunctions() from there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh true, I thought it was being called by default from the Init function. I tested the glfw/Vulkan example and it ran fine so I assumed it was working :) Will fix as soon as I get home.

Copy link
Contributor Author

@spnda spnda Jun 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Sorry completely forgot about this). I've now gone ahead and made it so that the function pointers are always loaded in the Init function if UseDynamicRendering is true. Question is if this is acceptable because it won't use any user-defined callback that the LoadFunctions callback does. (What is that even used for?)

Also, I find this comment quite interesting (and misleading):

    // You can use the default Vulkan loader using:
    //      ImGui_ImplVulkan_LoadFunctions([](const char* function_name, void*) { return vkGetInstanceProcAddr(your_vk_isntance, function_name); });
    // But this would be equivalent to not setting VK_NO_PROTOTYPES.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my suggestion in the other comment for handling LoadFunctions. If user gives a loader callback, we want to always use it, otherwise would be surprising and we would have to document.

What is the user provided loader used for? One use is some applications will not link at build time with the Vulkan Loader, instead will manually find and open the library and get the vkGetInstanceProcAddr by themselves. The custom function allow ImGui to grab all the functions it needs through that pointer.

As for the comment, I think is just pointing that if the vkGetInstanceProcAddr is available when linking during build, it is very likely the other core functions will be available. This could be tweaked but I suggest proposing the tweak in a separate PR.

@spnda spnda force-pushed the docking_dynamic_rendering branch from 76c602b to aad36a4 Compare June 17, 2023 15:41
Comment on lines 1079 to 1090
// Always laod the dynamic rendering function pointers, regardless of whether VK_NO_PROTOTYPES is defined
if (info->UseDynamicRendering) {
imgui_vkCmdBeginRenderingKHR = reinterpret_cast<PFN_vkCmdBeginRenderingKHR>(vkGetInstanceProcAddr(info->Instance, "vkCmdBeginRenderingKHR"));
imgui_vkCmdEndRenderingKHR = reinterpret_cast<PFN_vkCmdEndRenderingKHR>(vkGetInstanceProcAddr(info->Instance, "vkCmdEndRenderingKHR"));
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Couple of suggestions here:

  • In ImGui_ImplVulkan_LoadFunctions() you should use that function to load imgui_vkCmdBeginRenderingKHR and imgui_vkCmdEndRenderingKHR (if not available there we will have NULL and it is fine), otherwise you are bypassing the user loader in the combination of LoadFunctions+DynamicRendering. The case highlighted here should run only when LoadFunctions was not called.

  • After the highlighted load, it is probably good to ASSERT that if UseDynamicRendering is true, then both functions are non-NULL.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be addressed with eb95b8f.

@spnda spnda force-pushed the docking_dynamic_rendering branch from aad36a4 to eb95b8f Compare June 19, 2023 13:26
@cmarcelo
Copy link

@spnda I've tried to run the code with the examples I had and found some more issues. I've posted the suggestions above and a few fixes to the branch https://github.com/cmarcelo/imgui/commits/dynamic-rendering could you take a look?

@ocornut I've also made two extra "DO NOT MERGE" patches on top that change Vulkan GLFW example, just for testing. The docking behavior works (moving an imgui window OUT to create a new native window, and then back again) in both.

  • Use VK_KHR_dynamic_rendering as an extension (you see the example code needs to load the begin/end functions by itself).
  • Use VK_KHR_dynamic_rendering requiring Vulkan 1.3, and using the symbols directly in the example app.

Do you think is worth keeping at least one of these variants as a separate example of its own in the repo?

@ocornut
Copy link
Owner

ocornut commented Jun 21, 2023

Do you think is worth keeping at least one of these variants as a separate example of its own in the repo?

Thanks!
If anything it might be a #define in the same example. My gut-feeling is that we won't merge now but I'll keep a copy of this into a private branch for now.

Let me know when you feel there's something for me to do.
Quite overwhelmed with this (most things Vulkan related tbh) so better when it's neat and bite-sized.

Again, I'm not entirely opposed to requiring SDK 1.3 is that's helping the code. I am assuming there wouldn't be any strong incentive for people to NOT update?
Though I guess it is possible some platforms (e.g. consoles) may not support API 1.3.

@spnda spnda force-pushed the docking_dynamic_rendering branch from eb95b8f to be94e87 Compare June 21, 2023 16:57
@spnda
Copy link
Contributor Author

spnda commented Jun 21, 2023

@spnda I've tried to run the code with the examples I had and found some more issues. I've posted the suggestions above and a few fixes to the branch https://github.com/cmarcelo/imgui/commits/dynamic-rendering could you take a look?

Yeah most of these I already covered before reading that message and seeing you committed the stuff. I've just locally cherry picked your commit and squashed them together and also changed some stuff. There was a single issue in your commit on line 1722 and 1775 with the comma (yeah I know it compiles but this is not what the comma operator is useful for):

            VkImageMemoryBarrier barrier = {};
            barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
                    barrier.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
            barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;

@ocornut I've also made two extra "DO NOT MERGE" patches on top that change Vulkan GLFW example, just for testing. The docking behavior works (moving an imgui window OUT to create a new native window, and then back again) in both.

  • Use VK_KHR_dynamic_rendering as an extension (you see the example code needs to load the begin/end functions by itself).
  • Use VK_KHR_dynamic_rendering requiring Vulkan 1.3, and using the symbols directly in the example app.

Do you think is worth keeping at least one of these variants as a separate example of its own in the repo?

I also have essentially the same thing locally, but yeah I would personally also vouch for a separate example that uses the extension or 1.3, as you can have the same code use both because they are identical besides function/struct naming. However, the example would need a bit more code than what you currently have because of extension dependencies on other extensions or Vulkan versions.

And if @cmarcelo won't find another tiny detail in the implementation to complain about (thanks though 😄) I am always on the side of 'this is good now'.

@spnda
Copy link
Contributor Author

spnda commented Jul 3, 2023

No, that looks fine.

@cmarcelo
Copy link

cmarcelo commented Jul 3, 2023

Updated my branch in case it still helps.

ocornut pushed a commit that referenced this pull request Jul 4, 2023
Co-authored-by: Caio Oliveira <cmarcelo@gmail.com>
Simplified for master branch.

# Conflicts:
#	backends/imgui_impl_vulkan.cpp
ocornut added a commit that referenced this pull request Jul 4, 2023
Simplified for master branch.

# Conflicts:
#	backends/imgui_impl_vulkan.cpp
@ocornut
Copy link
Owner

ocornut commented Jul 4, 2023

Pushed 7812e83 + small amends 121072c + docking amends ac85738

Than you!

@ocornut ocornut closed this Jul 4, 2023
@peter1745
Copy link

Maybe it should be noted that this doesn't work with viewports? Currently it will cause a crash if you try to move an imgui window outside of the main window

@ocornut
Copy link
Owner

ocornut commented Jul 4, 2023

@peter1745 I have tested it with viewports both with and without UseDynamicRendering and both cases worked without a crash nor validation error. Can you clarify your issue?

@spnda
Copy link
Contributor Author

spnda commented Jul 4, 2023

Maybe it should be noted that this doesn't work with viewports? Currently it will cause a crash if you try to move an imgui window outside of the main window

I also didn't see this behaviour. I tested my code nultiple times with the GLFW example and moved the ImGui windows out of the parent window. Some stacktrace, error descripton, or, if applicable, some sort of GPU crash report would be very helpful.

@raaavioli
Copy link

raaavioli commented Nov 8, 2023

As @peter1745 mentioned it crashes in imgui_impl_vulkan.cpp in ImGui_ImplVulkan_RenderWindow. Specifically it happens when pulling a viewport window outside of the main window.

Namely ImGuiImplVulkanFuncs_vkCmdBeginRenderingKHR(fd->CommandBuffer, &renderingInfo); gives
Exception thrown at 0x0000000000000000 in VulkanToy.exe: 0xC0000005: Access violation executing location
despite the function being properly loaded in ImGui_ImplVulkan_Init on initialization. The function pointer is not null, so can't see what it's crashing on.

Stacktrace being:

ImGui_ImplVulkan_RenderWindow(ImGuiViewport * viewport, void * __formal) Line 1713 C++
ImGui::RenderPlatformWindowsDefault(void * platform_render_arg, void * renderer_render_arg) Line 14877 C++

Equivalently, we crash on ImGuiImplVulkanFuncs_vkCmdEndRenderingKHR after that as well.

Replacing both with vkCmdBeginRendering and vkCmdEndRendering respectively works, which should be fine since those are core in Vulkan 1.3, and IMGUI_IMPL_VULKAN_HAS_DYNAMIC_RENDERING requires vulkan 1.3 anyway.

Edit:
Adding the image showing the address is not null pointing into the vulkan-1 dll, however for some reason that function does not seem to be valid.
image

@ocornut ocornut reopened this Nov 9, 2023
@spnda
Copy link
Contributor Author

spnda commented Nov 9, 2023

As @peter1745 mentioned it crashes in imgui_impl_vulkan.cpp in ImGui_ImplVulkan_RenderWindow. Specifically it happens when pulling a viewport window outside of the main window.

Namely ImGuiImplVulkanFuncs_vkCmdBeginRenderingKHR(fd->CommandBuffer, &renderingInfo); gives

Exception thrown at 0x0000000000000000 in VulkanToy.exe: 0xC0000005: Access violation executing location

despite the function being properly loaded in ImGui_ImplVulkan_Init on initialization. The function pointer is not null, so can't see what it's crashing on.

Stacktrace being:

ImGui_ImplVulkan_RenderWindow(ImGuiViewport * viewport, void * __formal) Line 1713 C++

ImGui::RenderPlatformWindowsDefault(void * platform_render_arg, void * renderer_render_arg) Line 14877 C++

Equivalently, we crash on ImGuiImplVulkanFuncs_vkCmdEndRenderingKHR after that as well.

Replacing both with vkCmdBeginRendering and vkCmdEndRendering respectively works, which should be fine since those are core in Vulkan 1.3, and IMGUI_IMPL_VULKAN_HAS_DYNAMIC_RENDERING requires vulkan 1.3 anyway.

Edit:

Adding the image showing the address is not null pointing into the vulkan-1 dll, however for some reason that function does not seem to be valid.

image

@raaavioli What driver are you using? Does it perhaps support dynamicRendering through 1.3 but doesn't support the corresponding extension? I see that in the code for the docking branch I wrote it always tries to load the functions with the KHR suffix. This works in most cases, where the drivers will usually just expose both things and have function pointers with and without the suffix pointing to the same function, but I guess your driver might not support the extension in the same way.

@raaavioli
Copy link

raaavioli commented Nov 9, 2023

@spnda Running on a 1070 GPU with driver 545.84.
According to gpuinfo it supports dynamicRendering both through extensions from version r.1 and through the native 1.3 feature:
https://vulkan.gpuinfo.org/displayreport.php?id=25326#features_core_13
https://vulkan.gpuinfo.org/displayreport.php?id=25326#features_extensions

I think if we assume vulkan 1.3 anyway for dynamicRendering with IMGUI_IMPL_VULKAN_HAS_DYNAMIC_RENDERING, shouldn't it then be fine to also just use the core version of the function?

@spnda
Copy link
Contributor Author

spnda commented Nov 9, 2023

@spnda Running on a 1070 GPU with driver 545.84. According to gpuinfo it supports dynamicRendering both through extensions from version r.1 and through the native 1.3 feature: https://vulkan.gpuinfo.org/displayreport.php?id=25326#features_core_13 https://vulkan.gpuinfo.org/displayreport.php?id=25326#features_extensions

I think if we assume vulkan 1.3 anyway for dynamicRendering with IMGUI_IMPL_VULKAN_HAS_DYNAMIC_RENDERING, shouldn't it then be fine to also just use the core version of the function?

Where are we assuming Vulkan 1.3? The code was intended to run on both the core and the extension.

#if defined(VK_VERSION_1_3) || defined(VK_KHR_dynamic_rendering)
#define IMGUI_IMPL_VULKAN_HAS_DYNAMIC_RENDERING
static PFN_vkCmdBeginRenderingKHR ImGuiImplVulkanFuncs_vkCmdBeginRenderingKHR;
static PFN_vkCmdEndRenderingKHR ImGuiImplVulkanFuncs_vkCmdEndRenderingKHR;
#endif

And we have plenty of users who aren't running the latest drivers or have devices that don't support 1.3, so we should continue to support both.

Replacing both with vkCmdBeginRendering and vkCmdEndRendering respectively works, which should be fine since those are core in Vulkan 1.3, and IMGUI_IMPL_VULKAN_HAS_DYNAMIC_RENDERING requires vulkan 1.3 anyway.

Are you referring to the function strings in the vkGetDeviceProcAddr calls or are you replacing the function calls directly? Please try the former if you haven't already. That would be my first idea as to what's going wrong. Say you only enabled dynamicRendering from 1.3 but the driver specifically returns nullptr for the extension functions as they would be from a different feature. I personally only know how the MoltenVK driver handles function pointer loading, which doesn't discriminate between core or extension. Perhaps NVIDIA is doing it differently. And again, the preprocessor define does not require 1.3.

@raaavioli
Copy link

raaavioli commented Nov 10, 2023

@spnda Excuse me, I misread and thought it required defined(VK_VERSION_1_3) && defined(VK_KHR_dynamic_rendering)

I was refering to replace e.g ImGuiImplVulkanFuncs_vkCmdBeginRenderingKHR with vkCmdBeginRendering from vulkan_core.h, but then again, that won't work for applications not using 1.3 which depend on the extension.

It does indeed also work with loading the PFN_vkCmdBeginRendering "vkCmdBeginRendering" with vkGetInstanceProcAddr.

Edit: Querying device features on my device for VkPhysicalDeviceDynamicRenderingFeaturesKHR with VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR actually shows that the extension should be supported as well. So I have no idea why it crashes when invoking the loaded extension fn pointers.

@spnda
Copy link
Contributor Author

spnda commented Nov 11, 2023

@raaavioli Youve probably only enabled the dynamicRendering feature from 1.3, right? If you leave ImGui's code as-is, and enable the feature from the extension, what happens then? I think it should run fine. Also can you verify if the function pointers are nullptr when only 1.3 is enabled but the extension functions are loaded?

Remember that what a device supports and what you are enabling when creating your logical device is not necessarily the same, depending on how the driver is written.

@raaavioli
Copy link

raaavioli commented Nov 12, 2023

@spnda

Youve probably only enabled the dynamicRendering feature from 1.3, right?

Yes, I had only enabled dynamic rendering as a core feature in 1.3.

Also can you verify if the function pointers are nullptr when only 1.3 is enabled but the extension functions are loaded?

Not entirely sure what you mean. But yes, when enabling 1.3 only, the extension functions are loaded as nullptr.

I've realized a few things.

  1. It does not work if I use VkPhysicalDeviceFeatures2 passed to the pNext field of VkDeviceCreateInfo, which was what I used to enable dynamic rendering through VkPhysicalDeviceDynamicRenderingFeatures. I.e, If I instead load VkPhysicalDeviceDynamicRenderingFeaturesKHR, with VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR and pass it when creating the device, then the function pointers will be null, despite using vk 1.3.

  2. It does work if I pass VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME to ppEnabledExtensionNames. I.e, the function pointers are always valid when loading the extension through ppEnabledExtensionNames.

So, even if you are using 1.3, you currently need to enable VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME when creating the device to use dynamic rendering with ImGui (on some GPUs/drivers).

@spnda
Copy link
Contributor Author

spnda commented Nov 12, 2023

So yes, thats exactly what I thought was happening. Will look at a possible fix later.

The backend would need to know what was enabled at device creation time or some flag to know which one to load. Unsure what the best solution would be right now.

@spnda
Copy link
Contributor Author

spnda commented Nov 13, 2023

Reading the code I found // Need to explicitly enable VK_KHR_dynamic_rendering extension to use this, even for Vulkan 1.3. behind the UseDynamicRendering flag. @cmarcelo noticed this quirk and commented on this important piece accordingly. Technically the behaviour you experienced is the expected behaviour of the current code. The validation layers would've also said something if you had them on.

I think another PR should be made that widens support for dynamic rendering by differentiating function loading between the extension and Vulkan 1.3. Perhaps it's necessary to have a UseDynamicRenderingKHR and a UseDynamicRenderingCore flag to do the correct thing in both cases. Otherwise, some flag will have to be passed to ImGui_ImplVulkan_LoadFunctions and ImGui_ImplVulkan_Init. Though I am not sure what the best solution is for this currently, which is why I am currently reluctant of implementing a fix and opening a PR. As far as this PR goes it should be closed again, as it is technically not an issue.

ocornut pushed a commit that referenced this pull request Nov 15, 2023
… secondary window when enabling UseDynamicRendering. (#6999, #5446, #5037)
@ocornut
Copy link
Owner

ocornut commented Dec 19, 2023

I'm honestly not sure I understand this well enough, but closing based on your suggestion:

I think another PR should be made that widens support for dynamic rendering by differentiating function loading between the extension and Vulkan 1.3. Perhaps it's necessary to have a UseDynamicRenderingKHR and a UseDynamicRenderingCore flag to do the correct thing in both cases. Otherwise, some flag will have to be passed to ImGui_ImplVulkan_LoadFunctions and ImGui_ImplVulkan_Init. Though I am not sure what the best solution is for this currently, which is why I am currently reluctant of implementing a fix and opening a PR. As far as this PR goes it should be closed again, as it is technically not an issue.

Thank you for investigating this and possibly for next PR!

@ocornut ocornut closed this Dec 19, 2023
ocornut added a commit that referenced this pull request Feb 14, 2024
LalisaTM added a commit to LalisaTM/imgui that referenced this pull request Feb 25, 2025
commit 2db3e9d
Author: ocornut <omarcornut@gmail.com>
Date:   Tue Feb 25 17:11:56 2025 +0100

    Backends: SDL2, SDL3: Use display bounds when SDL_GetDisplayUsableBounds() fails or return a zero size. (ocornut#8415, ocornut#3457)

    Analoguous to aa8e09d for GLFW.

commit 9ab0b66
Author: ocornut <omarcornut@gmail.com>
Date:   Tue Feb 25 15:55:54 2025 +0100

    Backends: fixed comment to state that ImGuiViewport::PlaformHandle is used to store SDL's WindowID, not SDL_Window*. (ocornut#7853)

    Amend 2d99052

commit dd89bb1
Author: ocornut <omarcornut@gmail.com>
Date:   Fri Feb 21 23:51:30 2025 +0100

    Backends: DirectX11: configure swap chain creation for secondary viewports via undocumented ImGui_ImplDX11_SetSwapChainDescs(). (ocornut#5437, ocornut#7607, ocornut#7286, ocornut#2970)

commit 3064e6d
Author: Marius PvW <marius@taniustech.com>
Date:   Fri Feb 21 22:37:51 2025 +0100

    Viewports + Backends: Win32: Fixed setting title bar text when application is compiled without UNICODE. (ocornut#7979, ocornut#5725)

commit 6acdce7
Author: ocornut <omarcornut@gmail.com>
Date:   Fri Feb 21 22:12:53 2025 +0100

    Backends: Win32: use UnregisterClassW() for matching consistency. (ocornut#8423, ocornut#7979)

    Amend 3293ef8

commit 7730601
Merge: 1a7b594 434b771
Author: ocornut <omar@miracleworld.net>
Date:   Fri Feb 21 19:56:20 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	backends/imgui_impl_glfw.cpp
    #	backends/imgui_impl_glfw.h
    #	backends/imgui_impl_opengl3.cpp
    #	backends/imgui_impl_osx.h
    #	backends/imgui_impl_osx.mm
    #	backends/imgui_impl_sdl2.cpp
    #	backends/imgui_impl_sdl3.cpp
    #	backends/imgui_impl_win32.cpp
    #	imgui.cpp

commit 434b771
Author: ocornut <omarcornut@gmail.com>
Date:   Wed Feb 19 16:49:35 2025 +0100

    Internals: packing ImGuiDataVarInfo + misc renaming + value of ImGuiDataType_Pointer doesn't need to be Count+1

commit 1a7b594
Author: ocornut <omar@miracleworld.net>
Date:   Fri Feb 21 19:18:31 2025 +0100

    Backends: GLFW/SDL2/SDL3: Update monitors and work areas information every frame, as the later may change regardless of monitor changes. (ocornut#8415)

commit ea59440
Author: David Maas <contact@pathogenstudios.com>
Date:   Fri Feb 21 17:08:16 2025 +0100

    Backends: Win32: WM_SETTINGCHANGE's SPI_SETWORKAREA message also triggers a refresh of monitor list. (ocornut#8415)

commit 1e18a6c
Author: ocornut <omarcornut@gmail.com>
Date:   Fri Feb 21 16:55:35 2025 +0100

    Examples: GLFW+Vulkan: make GLFW_DIR overridable in cmake bit. (ocornut#8419)

commit a6bcbb1
Author: Tygyh <32486062+tygyh@users.noreply.github.com>
Date:   Thu Feb 20 18:07:25 2025 +0100

    Examples: Android: Update kotlin version (ocornut#8409)

commit 6dc376f
Author: ocornut <omar@miracleworld.net>
Date:   Thu Feb 20 11:54:32 2025 +0100

    ImFontAtlas: added software/drawlist version of ImGuiMouseCursor_Wait/ImGuiMouseCursor_Progress + moved GetMouseCursorTexData() to internals.

commit 85c488e
Author: ocornut <omar@miracleworld.net>
Date:   Thu Feb 20 11:46:56 2025 +0100

    Hot-fix for broken MouseDrawCursor support for ImGuiMouseCursor_Wait/ImGuiMouseCursor_Progress/ImGuiMouseCursor_NotAllowed.

    Amend 8a35386, eec097f.

commit 05742f9
Author: ocornut <omarcornut@gmail.com>
Date:   Wed Feb 19 10:55:44 2025 +0100

    Tables: share code between TableSetupColumn() and TableLoadSettings(). (ocornut#7934)

commit 8b7b3ce
Author: ocornut <omarcornut@gmail.com>
Date:   Wed Feb 19 10:14:38 2025 +0100

    Tables: fixed an issue where Columns Width state wouldn't be correctly restored when hot-reloading .ini state. (ocornut#7934)

    Amend 7cd31c3
    column->SortDirection initialized setting was wrong in first block but without side-effect, since sorting always stored explicitly in .ini data.

commit eec097f
Author: ocornut <omar@miracleworld.net>
Date:   Tue Feb 18 18:52:08 2025 +0100

    Added ImGuiMouseCursor_Progress mouse cursor 8a35386+ support in SDL2,SDL3,Win32,Allegro5 backends.

    Amend 8a35386

commit 8a35386
Author: ocornut <omar@miracleworld.net>
Date:   Tue Feb 18 18:40:47 2025 +0100

    Added ImGuiMouseCursor_Wait mouse cursor (busy/wait/hourglass shape) + support in SDL2,SDL3,Win32,Allegro5 backends.

commit 8f0411f
Author: ocornut <omar@miracleworld.net>
Date:   Tue Feb 18 18:19:10 2025 +0100

    Backends: OpenGL3: Lazily reinitialize embedded GL loader for when calling backend from e.g. other DLL boundaries. (ocornut#8406)

commit afd659b
Merge: a4ebe3d5 c4a32a1
Author: ocornut <omar@miracleworld.net>
Date:   Mon Feb 17 11:46:16 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	backends/imgui_impl_sdl2.cpp
    #	backends/imgui_impl_vulkan.cpp

commit c4a32a1
Author: Nico van Bentum <niico0708@gmail.com>
Date:   Thu Feb 13 21:50:12 2025 +0100

    Tabs: fixed middle-button to close not checking hovering, only close button visibility. (ocornut#8399, ocornut#8387)

    Main bug has been here since 54a60aa, but it's only ef7ffaf which made it very visible.

commit 78ec127
Author: ocornut <omar@miracleworld.net>
Date:   Fri Feb 14 21:39:45 2025 +0100

    ImDrawList: added InitialFringeScale in ImDrawListSharedData. Default to 1.0f.

    This is to allow some DPI mods with less changes. Only the initial value in SetupDrawListSharedData() will need change.

commit 2860d7b
Author: ocornut <omar@miracleworld.net>
Date:   Fri Feb 14 19:44:35 2025 +0100

    Selectable: Fixed horizontal label alignment with SelectableTextAlign.x > 0 and specifying a selectable size. (ocornut#8338)

    Regression from ed7551c

commit 474305c
Author: ocornut <omar@miracleworld.net>
Date:   Fri Feb 14 16:15:09 2025 +0100

    ImFont: simpler constructor.

commit ec4cd2c
Author: ocornut <omarcornut@gmail.com>
Date:   Fri Feb 14 12:19:24 2025 +0100

    Backends: Vulkan: Fixed crash with using no prototypes + *BREAKING* Added ApiVersion to ImGui_ImplVulkan_LoadFunctions(). (ocornut#8326, ocornut#8365, ocornut#8400)

commit a4ebe3d
Author: ocornut <omarcornut@gmail.com>
Date:   Fri Feb 14 12:04:05 2025 +0100

    Viewports: Fixed assertion when multi-viewports disabled and no monitor submitted. Reworked 95c4111. (ocornut#8401, ocornut#8393, ocornut#8385)

commit 98c2f6b
Author: ocornut <omar@miracleworld.net>
Date:   Thu Feb 13 16:19:41 2025 +0100

    Tables, Error Handling: Recovery from invalid index in TableSetColumnIndex(). (ocornut#1651)

commit e1ae7db
Author: ocornut <omar@miracleworld.net>
Date:   Thu Feb 13 16:03:40 2025 +0100

    Backends: Vulkan: Fixed building with older headers not supporting VK_HEADER_VERSION_COMPLETE. (ocornut#8326, ocornut#8365)

commit 12963f5
Author: ocornut <omar@miracleworld.net>
Date:   Thu Feb 13 15:49:47 2025 +0100

    Examples: Vulkan: make ApiVersion a little more visible in examples. (ocornut#8326, ocornut#8365)

commit 890ead6
Author: ocornut <omar@miracleworld.net>
Date:   Thu Feb 13 15:40:49 2025 +0100

    Backends: Vulkan: Added ApiVersion field in ImGui_ImplVulkan_InitInfo. Dynamic rendering path loads "vkCmdBeginRendering/vkCmdEndRendering" without -KHR on API 1.3. (ocornut#8326, ocornut#8365)

commit 95c4111
Author: Gabriel Rodriguez <gabrielrodriguez@mediamolecule.com>
Date:   Wed Feb 12 12:39:44 2025 +0100

    Viewports: default to first monitor is viewport is outside bounds. (ocornut#8393, ocornut#8385)

    Before the assert was introduced in d66f4e5 the viewport would be eventually clamped with ClampWindowPos using g.FallbackMonitor, but code would run temporarly with DpiScale=0.

commit f94a5f0
Author: Rémy Tassoux <contact@rt2.fr>
Date:   Thu Feb 13 14:30:49 2025 +0100

    Docs: Update doc about plutosvg (ocornut#8395)

commit b78cc37
Author: ocornut <omar@miracleworld.net>
Date:   Wed Feb 12 19:27:43 2025 +0100

    Backends: SDL2: Fixed build for versions older than 2.0.14. (ocornut#7660)

commit 71d39a4
Merge: 8679cfa a931fb7
Author: ocornut <omar@miracleworld.net>
Date:   Wed Feb 12 19:17:48 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	backends/imgui_impl_sdl2.cpp
    #	backends/imgui_impl_sdl3.cpp
    #	imgui.cpp
    #	imgui_internal.h

commit a931fb7
Author: ocornut <omar@miracleworld.net>
Date:   Wed Feb 12 19:15:00 2025 +0100

    Fixed static analyzer warning.

    (was harmless as initialized in NewFrame)

commit 7cd31c3
Author: ocornut <omar@miracleworld.net>
Date:   Wed Feb 12 19:08:52 2025 +0100

    Tables: tamed some .ini settings optimizations to more accurately allow overwriting/hot-reloading settings. (ocornut#7934)

commit 7221f5e
Author: ocornut <omar@miracleworld.net>
Date:   Wed Feb 12 19:01:02 2025 +0100

    Styles, Tabs: Fixed ef7ffaf. (ocornut#8387)

commit ef7ffaf
Author: ocornut <omar@miracleworld.net>
Date:   Wed Feb 12 15:46:17 2025 +0100

    Styles, Tabs: (Breaking) Renamed TabMinWidthForCloseButton to TabCloseButtonMinWidthUnselected. Added TabCloseButtonMinWidthSelected. (ocornut#8387)

commit 3d900ed
Author: PuPuHX <654524200@qq.com>
Date:   Tue Feb 11 10:57:47 2025 +0800

    Examples: Win32+DirectX12: Fixed ExampleDescriptorHeapAllocator overflow free index.

    Amend 40b2286.

commit 6916f93
Author: fdsa <14tanks999@gmail.com>
Date:   Tue Feb 11 13:12:55 2025 -0800

    InputText: Allow CTRL+Shift+Z to redo even outside of OSX. (ocornut#8389)

commit 3b2f260
Author: ocornut <omar@miracleworld.net>
Date:   Mon Feb 10 21:33:49 2025 +0100

    Windows: Fixed an issue where BeginChild() inside a collapsed Begin() wouldn't inherit the SkipItems flag.

    Amend/fix a89f05a (old!)
    Discovered while looking at glyph being processed in WIP branch.

commit 4dc9df6
Author: ocornut <omar@miracleworld.net>
Date:   Mon Feb 10 19:29:18 2025 +0100

    Tables: fixed an issue where Columns Visible/Hidden state wouldn't be correctly overridden when hot-reloading .ini state. (ocornut#7934)

commit 88cda0c
Author: ocornut <omar@miracleworld.net>
Date:   Mon Feb 10 12:39:54 2025 +0100

    Fixed minor warning. Added comment.

commit a431e12
Author: ocornut <omar@miracleworld.net>
Date:   Mon Feb 10 12:09:44 2025 +0100

    Backends: SDL2, SDL3:  Using SDL_Openurl("") in platform_io.Platform_OpenInShellFn handler. (ocornut#7660)

commit a18622c
Author: ocornut <omar@miracleworld.net>
Date:   Mon Feb 10 12:02:01 2025 +0100

    TextLinkOpenurl(""): fixed default Win32 io.PlatformOpenInShellFn handler to handle UTF-8 regardless of system regional settings. (ocornut#7660)

commit 2206e31
Author: ocornut <omar@miracleworld.net>
Date:   Mon Feb 10 11:37:55 2025 +0100

    Demo: Combos: demonstrate a very simple way to add a filter to a combo. (ocornut#718)

commit e8ad60c
Author: edenware <52419657+edenoftheware@users.noreply.github.com>
Date:   Fri Feb 7 21:01:46 2025 -0600

    Fix typo (ocornut#8382)

commit 50dbb08
Author: ocornut <omar@miracleworld.net>
Date:   Fri Feb 7 22:57:15 2025 +0100

    Tables: sneakily honor ImGuiNextWindowDataFlags_HasChildFlags/ImGuiNextWindowDataFlags_HasWindowFlags as a way to facilitate various hacks/workarounds.

commit e368015
Author: ocornut <omar@miracleworld.net>
Date:   Fri Feb 7 22:56:02 2025 +0100

    Tables: a clipped scrolling table correctly clears SetNextWindowXXX flags. (ocornut#8196)

    Amend 43c51eb

commit e5668b8
Author: ocornut <omar@miracleworld.net>
Date:   Fri Feb 7 22:48:31 2025 +0100

    Internals: rename ImGuiNextWindowData::Flags to HasFlags for consistency and to reduce mistakes.

commit 8679cfa
Merge: d803476 4982602
Author: ocornut <omar@miracleworld.net>
Date:   Fri Feb 7 18:27:32 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	backends/imgui_impl_glfw.cpp
    #	backends/imgui_impl_glfw.h
    #	examples/example_apple_metal/example_apple_metal.xcodeproj/project.pbxproj
    #	imgui.cpp

commit 4982602
Author: ocornut <omar@miracleworld.net>
Date:   Fri Feb 7 18:16:04 2025 +0100

    Windows, Style: Added style.WindowBorderHoverPadding setting to configure inner/outer padding applied to hit-testing of windows borders.

    Amend 3c7177c, 59f3c4f, ae7f833.
    Could be latched inside windows to be multi-dpi friendly, but likely won't matter soon.

commit 914fbcf
Author: ocornut <omar@miracleworld.net>
Date:   Fri Feb 7 16:23:00 2025 +0100

    Fonts: removed unnecessary const qualifier from ImFont::FindGlyph()

    Amend 0bde57c

commit 4f1d380
Author: fdsa <14tanks999@gmail.com>
Date:   Wed Feb 5 18:41:03 2025 -0800

    Fixed tabs and spaces (ocornut#8377)

commit 0625b37
Author: ocornut <omar@miracleworld.net>
Date:   Thu Feb 6 18:37:32 2025 +0100

    Scrollbar: Rework logic that fades-out scrollbar when it becomes too small.

    Amend 0236bc2

commit cfed18a
Author: ocornut <omar@miracleworld.net>
Date:   Thu Feb 6 12:34:37 2025 +0100

    Add ImFontConfig::GlyphExtraAdvanceX as a replacement for GlyphExtraSpacing.x (ocornut#242)

    Partly restore 1a31e31.

commit 2d20e13
Author: ocornut <omarcornut@gmail.com>
Date:   Tue Feb 4 20:19:57 2025 +0100

    Backends: GLFW: Added comment about io.AddMouseSourceEvent() not being properly called. (ocornut#8374)

commit d803476
Merge: 1820fe5 1a31e31
Author: ocornut <omar@miracleworld.net>
Date:   Mon Feb 3 18:42:24 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	backends/imgui_impl_metal.mm
    #	imgui.cpp
    #	imgui_internal.h

commit 1a31e31
Author: ocornut <omar@miracleworld.net>
Date:   Mon Feb 3 17:55:35 2025 +0100

    (Breaking) Fonts: removed ImFontConfig::GlyphExtraSpacing option which seems largely obsolete and unused. (ocornut#242)

commit de962e8
Author: ocornut <omar@miracleworld.net>
Date:   Mon Feb 3 17:50:12 2025 +0100

    ImFont: remove SetGlyphVisible()

    Which was never marked public. Added by d284a6c. (ocornut#2149, ocornut#515)
    Making room by removing stuff that are inconvenient to implement in our scaling system.
    If you were using this function please post an issue to report it.

commit da0ba9e
Author: PhantomCloak <unalozyurtrooter@hotmail.com>
Date:   Sun Feb 2 19:25:09 2025 +0300

    Backends: WebGPU: add type alias for dawn WGPUProgrammableStageDescriptor -> WGPUComputeState. (ocornut#8369)

commit 5dd8408
Author: ocornut <omar@miracleworld.net>
Date:   Mon Feb 3 15:11:03 2025 +0100

    InputTextWithHint(): Fixed buffer overflow when user callback modifies the buffer contents in a way that alters hint visibility. (ocornut#8368)

commit 204cebc
Author: ocornut <omar@miracleworld.net>
Date:   Mon Feb 3 14:21:53 2025 +0100

    Backends: Metal: Fixed a crash on application resources. (ocornut#8367, ocornut#7419) [@anszom]

commit 6265339
Author: ocornut <omar@miracleworld.net>
Date:   Mon Feb 3 14:01:48 2025 +0100

    Fixed IsItemDeactivatedAfterEdit() signal being broken for Checkbox(), RadioButton(), Selectable(). (ocornut#8370)

    Item is already made inactive at the time of calling MarkItemEdited().
    Fix a604d4f

commit f820bf7
Author: ocornut <omar@miracleworld.net>
Date:   Mon Feb 3 12:33:40 2025 +0100

    Version 1.91.9 WIP

commit e4db4e4
Author: ocornut <omar@miracleworld.net>
Date:   Fri Jan 31 19:50:18 2025 +0100

    Internals: renamed GetIOEx() to GetIO(). Added GetPlatformIO() explicit context variant. - OOPS

commit 1820fe5
Author: ocornut <omar@miracleworld.net>
Date:   Fri Jan 31 19:02:14 2025 +0100

    Comments, minor alignments tweaks.

commit e2a99b5
Author: ocornut <omar@miracleworld.net>
Date:   Fri Jan 31 18:26:52 2025 +0100

    Internals: renamed GetIOEx() to GetIO(). Added GetPlatformIO() explicit context variant.

commit 11b3a7c
Merge: c2dcc80 dbb5eea
Author: ocornut <omar@miracleworld.net>
Date:   Fri Jan 31 16:10:20 2025 +0100

    Merge branch 'master' into docking

commit dbb5eea
Author: ocornut <omar@miracleworld.net>
Date:   Fri Jan 31 15:57:48 2025 +0100

    Version 1.91.8

commit e6c5296
Author: Konstantin Podsvirov <konstantin@podsvirov.pro>
Date:   Fri Jan 31 16:11:33 2025 +0300

    Examples: SDL3: Fix for Emscripten platform (ocornut#8363)

commit ae6cfd3
Author: ocornut <omar@miracleworld.net>
Date:   Thu Jan 30 14:34:05 2025 +0100

    Tables, Menus: Fixed tables or child windows submitted inside BeginMainMenuBar() being unable to save their settings. (ocornut#8356)

    Amend error handling (fa178f4) to avoid us setting ImGuiWindowFlags_NoSavedSettings on the wrong window.

commit fa178f4
Author: ocornut <omar@miracleworld.net>
Date:   Thu Jan 30 14:30:14 2025 +0100

    Error Handling: Recovery from missing EndMenuBar() call. (ocornut#1651)

commit c2dcc80
Author: ocornut <omarcornut@gmail.com>
Date:   Thu Jan 30 11:39:52 2025 +0100

    Docking: fixed ImGuiWindowFlags_DockNodeHost/ImGuiWindowFlags_NavFlattened clash introduced by c38c18c just for 1.91.7 (ocornut#8357)

commit 1dc7762
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 29 20:13:22 2025 +0100

    Fixed zealous GCC warning. (ocornut#8355)

    Amend dfd1bc3

commit c0308da
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 29 20:13:22 2025 +0100

    Fixed zealous GCC warning. (ocornut#8355)

    Amend dfd1bc3

commit 0825952
Merge: 75d9965 dabc990
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 29 20:04:45 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	imgui.cpp
    #	imgui_internal.h

commit dabc990
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 29 19:59:41 2025 +0100

    Rename internal id for standardizing naming convention. "##menubar" -> "##MenuBar", "###NavWindowingList" -> "###NavWindowingOverlay"

    "###NavUpdateWindowing" one should have zero side effect on anyone.

commit a711915
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 29 19:07:28 2025 +0100

    EndMainMenuBar doesn't attempt to restore focus when there's an active id. (ocornut#8355)

    I don't have a specific issue in mind but it seems sane to add that test.

commit dfd1bc3
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 29 19:05:18 2025 +0100

    Tables, Menus: Fixed using BeginTable() in menu layer (any menu bar). (ocornut#8355)

commit 4230e98
Author: ocornut <omar@miracleworld.net>
Date:   Tue Jan 28 14:39:00 2025 +0100

    Error Handling, Debug Log: IMGUI_DEBUG_LOG_ERROR() doesn't need the extra variable.

    Amend 2360061

commit ea0da0b
Author: ocornut <omar@miracleworld.net>
Date:   Mon Jan 27 18:04:44 2025 +0100

    Extracted PushPasswordFont() out of InputText code.

commit 75d9965
Author: ocornut <omar@miracleworld.net>
Date:   Mon Jan 27 15:48:20 2025 +0100

    Docking: move DockTabItemStatusFlags stuff next to its peers in DC structure.

commit db4e541
Merge: 81dab64 9c4948a
Author: ocornut <omar@miracleworld.net>
Date:   Mon Jan 27 15:45:26 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	imgui.cpp
    #	imgui_internal.h
    #	imgui_widgets.cpp

commit 9c4948a
Author: ocornut <omar@miracleworld.net>
Date:   Mon Jan 27 15:41:24 2025 +0100

    TabBar: Internals: added TabItemSpacing(). (ocornut#8349, ocornut#3291)

commit a05d547
Author: ocornut <omar@miracleworld.net>
Date:   Mon Jan 27 14:39:26 2025 +0100

    Windows: separating WindowItemStatusFlags from ChildItemStatusFlag, because IsItemXXX _after_ BeginChild()>Begin() shouldn't return last status emitted by e.g. EndChild()

    As IsItemXXX() after is specced as returning title bar data we don't want to lock ourselves up from adding them to child window (e.g. MDI idea using windows to host child windows).

commit 134fbe1
Author: ocornut <omar@miracleworld.net>
Date:   Mon Jan 27 12:39:44 2025 +0100

    Windows: Fixed IsItemXXXX() functions not working on append-version of EndChild(). (ocornut#8350)

    Also made some of the fields accessible after BeginChild() to match Begin() logic.

commit 5a28f18
Author: ocornut <omar@miracleworld.net>
Date:   Mon Jan 27 12:27:10 2025 +0100

    Fixed parameter names to SetLastItemData() to align with current names.

commit 81dab64
Merge: 355cb58 96e3b14
Author: ocornut <omarcornut@gmail.com>
Date:   Sat Jan 25 01:15:30 2025 +0100

    Merge branch 'master' into docking

commit 96e3b14
Author: ocornut <omarcornut@gmail.com>
Date:   Sat Jan 25 01:14:46 2025 +0100

    Fixed build with IMGUI_ENABLE_FREETYPE (ocornut#8346)

commit afb6e9a
Author: ocornut <omar@miracleworld.net>
Date:   Fri Jan 24 20:03:04 2025 +0100

    Fonts: OversampleH auto-selection uses 36 as heuristic for now.

commit 355cb58
Merge: 64e738c 8a1613a
Author: ocornut <omar@miracleworld.net>
Date:   Fri Jan 24 19:40:54 2025 +0100

    Merge branch 'master' into docking, incl conflict merge in BeginMenuBar() for ocornut#8267

    # Conflicts:
    #	imgui_widgets.cpp

commit 8a1613a
Author: ocornut <omar@miracleworld.net>
Date:   Fri Jan 24 19:27:50 2025 +0100

    Fonts: OversampleH/OversampleV value defaults to 0 for automatic selection.

commit 4211fdc
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 22 15:44:51 2025 +0100

    ImFont: compact comments in header section.

commit 9eafb7b
Author: ocornut <omar@miracleworld.net>
Date:   Fri Jan 24 16:54:59 2025 +0100

    ImFont: IndexLookup[] table hold 16-bit values even in ImWchar32 mode.

commit 53244aa
Author: ocornut <omar@miracleworld.net>
Date:   Fri Jan 24 15:00:21 2025 +0100

    Amend 9bc5b04 with a shadowed variable warning fix.

commit ed7551c
Author: ocornut <omar@miracleworld.net>
Date:   Fri Jan 24 14:59:37 2025 +0100

    Selectable: Fixed horizontal label alignment when combined with using ImGuiSelectableFlags_SpanAllColumns. (ocornut#8338)

commit bbf9578
Author: ocornut <omar@miracleworld.net>
Date:   Fri Jan 24 14:43:16 2025 +0100

    Amend 9bc5b04 to avoid using GImGui mid-function.

commit 9bc5b04
Author: ocornut <omar@miracleworld.net>
Date:   Fri Jan 24 14:39:07 2025 +0100

    Windows, Style: Fixed small rendering issues with menu bar, resize grip and scrollbar when using thick border sizes. (ocornut#8267, ocornut#7887)

    Amend e.g. 742b5f4.

commit 1019934
Author: ocornut <omar@miracleworld.net>
Date:   Thu Jan 23 11:31:32 2025 +0100

    ImFontAtlas: made calling ClearFonts() call ClearInputData(). (ocornut#8174, ocornut#6556, ocornut#6336, ocornut#4723)

commit 71da34c
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 22 16:56:18 2025 +0100

    Debug Tools: Tweaked font preview + indent "Glyphs" block.

commit 64e738c
Merge: a3802c8 6906ac9
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 22 12:19:09 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	imgui.cpp

commit 6906ac9
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 22 12:12:07 2025 +0100

    ColorEdit, ColorPicker: (Breaking) redesigned how alpha is displayed in the preview square. (ocornut#8335, ocornut#1578, ocornut#346)

    Added ImGuiColorEditFlags_AlphaOpaque, ImGuiColorEditFlags_AlphaNoBg.
    Removed ImGuiColorEditFlags_AlphaPreview.

commit fdca6c0
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 22 11:28:47 2025 +0100

    Inputs: added IsMouseReleasedWithDelay() helper. (ocornut#8337, ocornut#8320)

commit d17e9fc
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 22 10:32:09 2025 +0100

    Backends: SDL_GPU: shallow tweaks + disable anisotropy in sampler. Examples: SDL+Vulkan: Fixed incorrect defines.

commit 3e6bdc2
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 22 10:22:31 2025 +0100

    Examples: SDL3+SDL_GPU: use SDL_GPU_PRESENTMODE_MAILBOX swapchain parameters.

commit a3802c8
Author: David Maas <contact@pathogenstudios.com>
Date:   Wed Jan 22 10:01:40 2025 +0100

    Backends: SDL3: new viewport windows are created with the SDL_WINDOW_HIDDEN flag before calling SDL_ShowWindow(). (ocornut#8328

    Unsure why it was missing from a526ff8

commit bf13442
Author: ocornut <omar@miracleworld.net>
Date:   Tue Jan 21 14:59:29 2025 +0100

    Moved ImGuiColorEditFlags_AlphaPreview/ImGuiColorEditFlags_AlphaPreviewHalf flags. Demo: reorganized some of color edit/picker demo section.

commit 2af26b7
Author: David Maas <contact@pathogenstudios.com>
Date:   Tue Jan 21 14:25:39 2025 +0100

    ColorEdit, ColorPicker: Fixed alpha preview broken in 1.91.7. (ocornut#8336, ocornut#8241). [@PathogenDavid]

    ImAlphaBlendColors() was broken by ImLerp() change. (cd6c83c)

commit 7ae7c90
Author: ocornut <omar@miracleworld.net>
Date:   Tue Jan 21 13:55:44 2025 +0100

    Tabs, Style: reworked selected overline rendering to better accommodate for rounded tabs. (ocornut#8334)

commit 6e94f6c
Merge: 109dd2b e8779a6
Author: ocornut <omar@miracleworld.net>
Date:   Mon Jan 20 18:04:31 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	backends/imgui_impl_osx.mm
    #	backends/imgui_impl_sdl2.cpp
    #	backends/imgui_impl_sdl3.cpp
    #	imgui.cpp
    #	imgui_internal.h

commit e8779a6
Author: ocornut <omar@miracleworld.net>
Date:   Mon Jan 20 17:55:09 2025 +0100

    Font: direct AddText()/RenderText() calls don't need to call strlen() if below clipping region.

    Unlikely to meaningful affect anyone but still..

commit 4c2e7bb
Author: ocornut <omar@miracleworld.net>
Date:   Mon Jan 20 15:24:46 2025 +0100

    Backends: SDL2,SDL3: removed assert preventing using ImGui_ImplSDL2_SetGamepadMode()/ImGui_ImplSDL3_SetGamepadMode() with ImGui_ImplSDL2_GamepadMode_Manual/ImGui_ImplSDL3_GamepadMode_Manual and an empty array. (ocornut#8329)

commit 8b0af7f
Author: ocornut <omar@miracleworld.net>
Date:   Mon Jan 20 14:30:40 2025 +0100

    Backends: SDL: update comments regarding API stability, regarding SDL_GPU and SDL_Renderer.

commit aa1b4ea
Author: Julian Rachele <julrachele@gmail.com>
Date:   Sun Jan 19 16:30:15 2025 -0500

    Backends: OSX: Remove notification observer when shutting down. (ocornut#8331)

commit aa23f38
Author: Daniel K. O. (dkosmari) <none@none>
Date:   Fri Jan 17 19:18:05 2025 -0300

    Backends: SDL_Renderer2/3: Use endian-dependent RGBA32 texture format, to match SDL_Color. (ocornut#8327)

commit 80c9cd1
Author: ocornut <omar@miracleworld.net>
Date:   Sat Jan 18 16:43:17 2025 +0100

    Font: reduce unnecessary padding in ImFontConfig struct too.

commit d7454de
Author: ocornut <omar@miracleworld.net>
Date:   Fri Jan 17 18:09:28 2025 +0100

    Font: minor tweak to struct alignment.

commit dd89a37
Author: ocornut <omar@miracleworld.net>
Date:   Fri Jan 17 17:11:22 2025 +0100

    Backends: Vulkan: sharing duplicate code. (ocornut#5446, ocornut#8326)

commit 487d7f9
Author: ocornut <omar@miracleworld.net>
Date:   Thu Jan 16 22:30:43 2025 +0100

    Font: Internals: make used page maps smaller. Since it's extremely rarely used and for iterations only. ~34->16 bytes with ImWchar32.

commit f2262eb
Author: ocornut <omar@miracleworld.net>
Date:   Thu Jan 16 19:46:54 2025 +0100

    Windows: latch FontRefSize at time of Begin(), consistent with e.g. TitleBarHeight, and to avoid calling CalcFontSize() on non-current window.

commit b7c27c5
Author: ocornut <omar@miracleworld.net>
Date:   Thu Jan 16 19:07:09 2025 +0100

    Windows: legacy SetWindowFontScale() is properly inherited by nested child windows. (ocornut#2701, ocornut#8138, ocornut#1018)

commit 4c64ba1
Author: ocornut <omar@miracleworld.net>
Date:   Thu Jan 16 17:42:00 2025 +0100

    imgui_freetype: fixed issue where glyph advances would incorrectly be snapped to pixels.

commit 0077357
Author: Diego Mateos <diego.mateos@mecalux.com>
Date:   Thu Jan 16 17:10:26 2025 +0100

    Ignore vscode artifacts (ocornut#8324)

commit b4a5d1d
Author: ocornut <omar@miracleworld.net>
Date:   Thu Jan 16 12:42:54 2025 +0100

    Backends: SDLGPU3: Rename GpuDevice->Device. Expose ImGui_ImplSDLGPU3_CreateDeviceObjects(), ImGui_ImplSDLGPU3_DestroyDeviceObjects(). Misc renaming. (ocornut#8163, ocornut#7998, ocornut#7988)

commit 109dd2b
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 15 17:50:57 2025 +0100

    Backends: Vulkan: VK_SUBOPTIMAL_KHR doesn't skip frame. (ocornut#7831, ocornut#7825)

commit 507cdba
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 15 17:38:37 2025 +0100

    Backends: Vulkan: vkQueuePresentKHR() returning VK_SUBOPTIMAL_KHR keeps moving forward. (ocornut#7825)

commit 015186a
Merge: b9badb5 0f33d71
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 15 17:34:17 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	backends/imgui_impl_dx12.cpp
    #	backends/imgui_impl_vulkan.cpp

commit 0f33d71
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 15 17:25:44 2025 +0100

    Examples: Vulkan: vkAcquireNextImageKHR() and vkQueuePresentKHR() returning VK_SUBOPTIMAL_KHR keeps moving forward. (ocornut#7825, ocornut#7831)

commit b9badb5
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 15 17:08:04 2025 +0100

    Backends: Vulkan: removed misleading code incrementing frameindex. (ocornut#7834)

    Thanks NostraMagister!

commit 8ebf22d
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 15 16:10:47 2025 +0100

    Backends: Vulkan: use ImVector<> for simplicity.

commit 6684984
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 15 15:13:05 2025 +0100

    Examples: DirectX12: Reduced number of frame in flight from 3 to 2 in provided example, to reduce latency.

commit 0e21bde
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 15 13:58:38 2025 +0100

    Misc shallow merge to reduce diff in other branches.

commit 8a9de84
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 15 13:47:52 2025 +0100

    FontAtlas: reduced baked IM_DRAWLIST_TEX_LINES_WIDTH_MAX from 63 to 32. (ocornut#3245)

commit 100075f
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 15 12:05:33 2025 +0100

    Backends: DirectX12: Texture upload use the command queue provided in ImGui_ImplDX12_InitInfo instead of creating its own.

    + minor tweaks to faciliate branch merging.

commit c59a226
Author: ocornut <omar@miracleworld.net>
Date:   Wed Jan 15 11:58:47 2025 +0100

    Version 1.91.8 WIP

commit c0ae325
Merge: d0d571e 5c1d2d1
Author: ocornut <omar@miracleworld.net>
Date:   Tue Jan 14 13:46:39 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	imgui.cpp

commit 5c1d2d1
Author: ocornut <omar@miracleworld.net>
Date:   Tue Jan 14 13:16:43 2025 +0100

    Version 1.91.7

commit 9f8481a
Author: ocornut <omar@miracleworld.net>
Date:   Tue Jan 14 13:14:50 2025 +0100

    (Breaking) TreeNode: renamed ImGuiTreeNodeFlags_SpanTextWidth to ImGuiTreeNodeFlags_SpanLabelWidth. (ocornut#6937)

commit 21902e2
Author: ocornut <omar@miracleworld.net>
Date:   Mon Jan 13 19:51:15 2025 +0100

    Backends: SDL_GPU: fixed SDL_GPUViewport initialisation. (ocornut#8163, ocornut#7998, ocornut#7988)

    Probably harmless. Amend 8bbccf7

commit c38c18c
Author: ocornut <omar@miracleworld.net>
Date:   Mon Jan 13 19:39:57 2025 +0100

    Avoid using 1<<31 for ImGuiWindowFlags_NavFlattened as it seems to confuse some binding generators.

commit c5f6094
Author: ocornut <omar@miracleworld.net>
Date:   Mon Jan 13 19:18:05 2025 +0100

    Demo: tweak demo for ImGuiTreeNodeFlags_LabelSpanAllColumns. (ocornut#8318, ocornut#3565)

commit 290e402
Author: ocornut <omar@miracleworld.net>
Date:   Mon Jan 13 18:55:09 2025 +0100

    TreeNode, Tables: added ImGuiTreeNodeFlags_LabelSpanAllColumns. (ocornut#8318, ocornut#3565)

commit 6fb7d44
Author: ocornut <omar@miracleworld.net>
Date:   Mon Jan 13 16:46:29 2025 +0100

    Backends: SDL2/SDL3: Comments. (ocornut#7672, ocornut#7670)

commit 32cea85
Author: ocornut <omar@miracleworld.net>
Date:   Mon Jan 13 15:51:39 2025 +0100

    Debug Tools:  Item Picker: Always available in menu. Tweak Demo Debug Options. (ocornut#2673, ocornut#1651)

commit 00f12b9
Author: ocornut <omar@miracleworld.net>
Date:   Mon Jan 13 15:22:45 2025 +0100

    InputText: Fixed not calling CallbackEdit on revert/clear with Escape key. (ocornut#8273) + rework comments.

    Seems like there is no reason to not run that path. Amend ancient 9501cd9, f3ab5e6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants