This pull request resolves #9374 - it adds support for VK_EXT_descriptor_heap, based on #9437, with example usage moved from the win32_vulkan to glfw_vulkan.
Because of this note in the feature descriptions, mixing descriptor heaps with other binding models in the same command buffer is undefined. That leaves two options: (1) switch binding modes between heap and non-heap draws, or (2) use app-provided callbacks for heap slots. As noted in #9437, (1) would be too slow due to frequent backend switching, so this PR uses (2), similar to DX12's SrvDescriptorAllocFn / SrvDescriptorFreeFn.
In heap mode, ImTextureID is a non-zero heap index (index 0 is reserved because ImTextureID_Invalid is 0). Pool-path AddTexture / RemoveTexture are unavailable; the application instead sets Register* / UnRegister* callbacks on ImGui_ImplVulkan_InitInfo::DescriptorHeapInfo. Support is gated on IMGUI_IMPL_VULKAN_HAS_DESCRIPTOR_HEAP (Vulkan headers that define VK_EXT_descriptor_heap).
Using the descriptor heap requires enabling VK_EXT_descriptor_heap, VK_KHR_maintenance5, VK_KHR_buffer_device_address (or Vulkan 1.2+), and VK_KHR_shader_untyped_pointers for ImGui's default heap shaders.
examples/example_glfw_vulkan enables the heap when available. There is --require-descriptor-heap flag added to require it (or exit on failure).
Activity
11663d134