ocornut / imgui

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
MIT License
57.74k stars 9.9k forks source link

Glad2 Vulkan support #7759

Open CyberFlex1984 opened 3 days ago

CyberFlex1984 commented 3 days ago

Version/Branch of Dear ImGui:

master

Back-ends:

imgui_impl_vulkan.cpp + imgui_impl_glfw.cpp

Compiler, OS:

Arch Linux GCC 14

Full config/build information:

No response

Details:

Add Vulkan glad2 support!

When I use glad2 for Vulkan I get errors that the imgui library cannot find Vulkan functions. I created this hotfix to resolve this issue. Error example: imgui/backends/imgui_impl_vulkan.cpp:1582:(.text+0x4936): undefined reference to vkDestroySemaphore

In imgui_impl_vulkan.h we should change 56-66 lines to:

#ifdef IMGUI_IMPL_VULKAN_USE_VOLK
#include <volk.h>
#else
#ifdef IMGUI_IMPL_VULKAN_USE_GLAD
#include <glad/vulkan.h>
#else
#include <vulkan/vulkan.h>
#endif
#endif

And also fix 96 line from VkPipelineRenderingCreateInfoKHR to VkPipelineRenderingCreateInfo

Thanks for attention!

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

No response

ocornut commented 2 days ago

(FFS, another Vulkan loader. Vulkan is going the route of OpenGL :( )

Linking to #6582