From e1ae7db4cccf1cb6a516a43dd8f63899f504ca52 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 13 Feb 2025 16:03:40 +0100 Subject: [PATCH] Backends: Vulkan: Fixed building with older headers not supporting VK_HEADER_VERSION_COMPLETE. (#8326, #8365) --- backends/imgui_impl_vulkan.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backends/imgui_impl_vulkan.cpp b/backends/imgui_impl_vulkan.cpp index 7be2ed1d1..af084cc0e 100644 --- a/backends/imgui_impl_vulkan.cpp +++ b/backends/imgui_impl_vulkan.cpp @@ -1159,7 +1159,14 @@ bool ImGui_ImplVulkan_Init(ImGui_ImplVulkan_InitInfo* info) bd->VulkanInitInfo = *info; if (bd->VulkanInitInfo.ApiVersion == 0) + { + // We don't care about other versions for now, so don't need to make this exhaustive (with #ifdef VK_VERSION_1_X checks) +#ifdef VK_HEADER_VERSION_COMPLETE bd->VulkanInitInfo.ApiVersion = VK_HEADER_VERSION_COMPLETE; +#else + bd->VulkanInitInfo.ApiVersion = VK_API_VERSION_1_0; +#endif + } ImGui_ImplVulkan_CreateDeviceObjects();