Skip to content

Segfault in ImGui_ImplVulkan_LoadDynamicRenderingFunctions #8400

Closed
@vaylor27

Description

@vaylor27

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions