1
0
mirror of https://github.com/ocornut/imgui.git synced 2025-02-20 04:21:01 +01:00

Backends: Vulkan: Fixed building with older headers not supporting VK_HEADER_VERSION_COMPLETE. (#8326, #8365)

This commit is contained in:
ocornut 2025-02-13 16:03:40 +01:00
parent 12963f5231
commit e1ae7db4cc

View File

@ -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();