You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
You can actually use GLAD2 with VOLK, without touching ImGui sources. Volk has a compile time define VOLK_VULKAN_H_PATH we can use! I used the example_sdl2_vulkan with cmake as my starting point but I am sure you can make it work with glfw.
Add to cmake target_include_directories so it includes the unzipped GLAD2 include folder
Download VOLK and add to target_include_directories so it includes volk.h. You actually have to edit the ImGui sources here a bit, but just replace <Volk/volk.h> to "volk.h" or use the specified directory name for the repo and include that, or whatever, but this should not be a problem here.
Add to cmake target_compile_definitions so it defines -DIMGUI_IMPL_VULKAN_USE_VOLK and -DVOLK_VULKAN_H_PATH="glad/vulkan.h"
Build with cmake, the example works without including the system <vulkan/vulkan.h>!
Also VkPipelineRenderingCreateInfoKHR will be available with VK_KHR_dynamic_rendering extension or vulkan 1.3 (can be vulkan 1.0-1.3).
In contrast VkPipelineRenderingCreateInfo will only be available in vulkan 1.3 so if you want to reach the widest audience I would suggest to use VkPipelineRenderingCreateInfoKHR.
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:And also fix 96 line from
VkPipelineRenderingCreateInfoKHR
toVkPipelineRenderingCreateInfo
Thanks for attention!
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
No response
The text was updated successfully, but these errors were encountered: