Backends: Vulkan: Add VK_EXT_descriptor_heap support - #9506
Conversation
|
Please rebase this over master to reduce the number of noise commits, if you can (else I can do it). |
19aa049 to
efaa94d
Compare
|
I rebased over master as requested. |
Fix: applied coding style Fix: Fixed Vulkan pNext chain when using both Dynamic Rendering and Descriptor Heaps.
…te heap API with IMGUI_IMPL_VULKAN_HAS_DESCRIPTOR_HEAP, and load vkCmdPushDataEXT via vkGetDeviceProcAddr. Fix: Fix pNext chain overwrite in pipeline creation
…isallow AddTexture when DescriptorHeapInfo is set
…nfo UnRegisterImage like DX12 SrvDescriptorFreeFn Fix: Rename target glsl_shader_heap file in validation command to match the existing one
…ture and descriptor heaps
…HAS_DESCRIPTOR_HEAP
Chore: Add changelog note scratch regarding adding support for VK_EXT_descriptor_heap Examples: Remove and shorten the old comment info
efaa94d to
89601b2
Compare
|
There were lots of unrelated commits that I removed now, also squashed a few of your commits. |
In short, this PR is based on #9437 and is meant to replace it. |
|
This needs to be simplified. All 5 examples should support the same thing, so perhaps a shared optional helper in imgui_impl_vulkan.cpp can be considered. |
|
Okay, I will then move the free-list, bindings, and checks for required extentions into an optional helper and use it in all of the Vulkan examples. |
To simplify back and forth, while this in the work it's ok if you update a single example. |
This pull request resolves #9374 - it adds support for VK_EXT_descriptor_heap, based on #9437, with example usage moved from the
win32_vulkantoglfw_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,
ImTextureIDis a non-zero heap index (index 0 is reserved becauseImTextureID_Invalidis 0). Pool-pathAddTexture/RemoveTextureare unavailable; the application instead setsRegister*/UnRegister*callbacks onImGui_ImplVulkan_InitInfo::DescriptorHeapInfo. Support is gated onIMGUI_IMPL_VULKAN_HAS_DESCRIPTOR_HEAP(Vulkan headers that defineVK_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+), andVK_KHR_shader_untyped_pointersfor ImGui's default heap shaders.examples/example_glfw_vulkanenables the heap when available. There is--require-descriptor-heapflag added to require it (or exit on failure).