Skip to content

Dynamic rendering and Vulkan 1.3 and higher #8326

@mklefrancois

Description

@mklefrancois

Version/Branch of Dear ImGui:

Version 1.91,3, Branch : docking

Back-ends:

imgui_impl_vulkan.cpp

Compiler, OS:

Windows 11

Full config/build information:

No response

Details:

With dynamic rendering active, the Vulkan backend loads vkCmdBeginRenderingKHR and vkCmdEndRenderingKHR, but those are only valid when the extension VK_KHR_dynamic_rendering was added to the device creation, where vkCmdBeginRendering and vkCmdEndRendering (without KHR), exists if the Vulkan 1.3 API is used.

See vkCmdBeginRenderingKHR specification.

My suggestion would be to add to ImGui_ImplVulkan_InitInfo an .ApiVersion and do something like

      if(info->ApiVersion < VK_API_VERSION_1_3)
      {
        ImGuiImplVulkanFuncs_vkCmdBeginRenderingKHR =
            reinterpret_cast<PFN_vkCmdBeginRenderingKHR>(vkGetInstanceProcAddr(info->Instance, "vkCmdBeginRenderingKHR"));
        ImGuiImplVulkanFuncs_vkCmdEndRenderingKHR =
            reinterpret_cast<PFN_vkCmdEndRenderingKHR>(vkGetInstanceProcAddr(info->Instance, "vkCmdEndRenderingKHR"));
      }
      else
      {
        ImGuiImplVulkanFuncs_vkCmdBeginRenderingKHR =
            reinterpret_cast<PFN_vkCmdBeginRenderingKHR>(vkGetInstanceProcAddr(info->Instance, "vkCmdBeginRendering"));
        ImGuiImplVulkanFuncs_vkCmdEndRenderingKHR =
            reinterpret_cast<PFN_vkCmdEndRenderingKHR>(vkGetInstanceProcAddr(info->Instance, "vkCmdEndRendering"));
      }

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

I don't have the example public yet, but found this while porting and modernizing https://github.com/nvpro-samples/vk_mini_samples to Vulkan 1.4

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions