Skip to content
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

Segfault in ImGui_ImplVulkan_LoadDynamicRenderingFunctions #8400

Closed
vaylor27 opened this issue Feb 14, 2025 · 1 comment
Closed

Segfault in ImGui_ImplVulkan_LoadDynamicRenderingFunctions #8400

vaylor27 opened this issue Feb 14, 2025 · 1 comment

Comments

@vaylor27
Copy link

Version/Branch of Dear ImGui:

Version 1.91.9 WIP, Branch: master.

Back-ends:

imgui_impl_sdl3.cpp + imgui_impl_vulkan.cpp

Compiler, OS:

Windows 11 + MSVC && MacOS 13 Ventura + Apple Clang

Full config/build information:

No response

Details:

upon calling ImGui_ImplVulkan_Init, there is a segmentation fault in ImGui_ImplVulkan_LoadDynamicRenderingFunctions, due to it calling ImGui_ImplVulkan_GetBackendData, which gets the value of ImGui::GetIO().BackendRendererUserData. The problem arises in the fact that this isn't set until line 1143 of imgui_impl_vulkan.cpp, while ImGui_ImplVulkan_LoadDynamicRenderingFunctions is called before this, at line 1128. On top of this, the value cannot even be set manually, as imgui will assert, claiming that the renderer backend has already been initialized.

Proposed solution: Move lines 1124 - 1134 (the if statement containing the check for dynamic rendering) after the value for ImGui::GetIO().BackendRendererUserData is set.

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

ocornut added a commit that referenced this issue Feb 14, 2025
…dded ApiVersion to ImGui_ImplVulkan_LoadFunctions(). (#8326, #8365, #8400)
@ocornut
Copy link
Owner

ocornut commented Feb 14, 2025

Caused by 890ead6, 12963f5, e1ae7db pushed yesterday.

Were you also using VK_NO_PROTOTYPES or a specific loader?

I have now pushed a fix ec4cd2c which unfortunately required to add an ApiVersion parameter to ImGui_ImplVulkan_LoadFunctions(), because that other path would have had the same problem without an easy fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants