Vulkan: Add note regarding lifetime of descriptor heap resources

Chore: Add changelog note scratch regarding adding support for VK_EXT_descriptor_heap

Examples: Remove and shorten the old comment info
This commit is contained in:
Jan Aleksander Górski 2026-08-06 05:50:12 +09:00 committed by ocornut
parent e9c79e349a
commit 438160954e
3 changed files with 3 additions and 2 deletions

View File

@ -27,6 +27,7 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2026-08-05: Vulkan: Added optional VK_EXT_descriptor_heap support via ImGui_ImplVulkan_InitInfo::DescriptorHeapInfo (app-owned Register*/UnRegister* callbacks). ImTextureID is a GPU descriptor device address (like DX12). Requires IMGUI_IMPL_VULKAN_HAS_DESCRIPTOR_HEAP (headers with VK_EXT_descriptor_heap).
// 2026-04-23: Added support for standard draw callbacks (in platform_io): DrawCallback_ResetRenderState, DrawCallback_SetSamplerLinear, DrawCallback_SetSamplerNearest. (#9378)
// 2026-04-22: *BREAKING CHANGE* redesigned to use separate ImageView + Sampler instead of Combined Image Sampler. This change allows us to facilitate changing samplers, in line with other backends.
// - When registering custom textures: changed ImGui_ImplVulkan_AddTexture() signature to remove Sampler.

View File

@ -129,6 +129,7 @@ struct ImGui_ImplVulkan_DescriptorHeapInfo
// - The application owns heap slots via Register*/UnRegister* callbacks.
// - ImTextureID is the GPU descriptor device address returned by RegisterImage.
// Requires a 64-bit ImTextureID.
// - DescriptorHeapInfo pointer and ResourceHeapAddress/ImageDescriptorSize must remain valid for the backend lifetime; if you recreate the heap, update those fields and re-register textures (old ImTextureIDs become invalid).
// - ImGui_ImplVulkan_AddTexture()/RemoveTexture() are pool-path only.
// - Device extensions / features the application must enable:
// - VK_EXT_descriptor_heap (feature: descriptorHeap).

View File

@ -456,8 +456,7 @@ static void SetupVulkan(ImVector<const char*> instance_extensions, bool require_
g_SamplerHeapAlloc.Create(g_Device, g_PhysicalDevice, descriptor_heap_properties.samplerDescriptorSize, descriptor_heap_properties.samplerHeapAlignment,
descriptor_heap_properties.minSamplerHeapReservedRange, APP_SAMPLER_HEAP_SIZE, g_Allocator);
// Allocating descriptors is up to the application, so we provide callbacks (same idea as DX12 SrvDescriptorAllocFn/FreeFn).
// ImTextureID = GPU descriptor device address (like D3D12_GPU_DESCRIPTOR_HANDLE.ptr); slot 0 is usable.
// Allocating descriptors is up to the application, so we provide callbacks. ImTextureID = GPU descriptor device address.
g_DescriptorHeapInfo = {};
g_DescriptorHeapInfo.ResourceHeapAddress = g_ResourceHeapAlloc.BindInfo.heapRange.address;
g_DescriptorHeapInfo.ImageDescriptorSize = g_ResourceHeapAlloc.Stride;