Skip to content

Commit

Permalink
Backends: Vulkan: Fixed building with older headers not supporting VK…
Browse files Browse the repository at this point in the history
…_HEADER_VERSION_COMPLETE. (ocornut#8326, ocornut#8365)
  • Loading branch information
ocornut committed Feb 13, 2025
1 parent 12963f5 commit e1ae7db
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions backends/imgui_impl_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit e1ae7db

Please sign in to comment.