From 6d1f835a2a465b034feddd7480b4947bd7ec59a9 Mon Sep 17 00:00:00 2001 From: Lukasz Stalmirski Date: Tue, 1 Sep 2026 20:20:31 +0200 Subject: [PATCH] Simplify the diff --- backends/imgui_impl_vulkan.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/backends/imgui_impl_vulkan.cpp b/backends/imgui_impl_vulkan.cpp index 61a399534..3d31dbf7f 100644 --- a/backends/imgui_impl_vulkan.cpp +++ b/backends/imgui_impl_vulkan.cpp @@ -232,8 +232,9 @@ static bool g_FunctionsLoaded = true; struct ImGui_ImplVulkan_Functions { +// Define function pointers #define IMGUI_VULKAN_FUNC_DEF(func) PFN_##func pfn_##func; - IMGUI_VULKAN_FUNC_MAP(IMGUI_VULKAN_FUNC_DEF) +IMGUI_VULKAN_FUNC_MAP(IMGUI_VULKAN_FUNC_DEF) #undef IMGUI_VULKAN_FUNC_DEF }; @@ -241,7 +242,7 @@ struct ImGui_ImplVulkan_Functions static ImGui_ImplVulkan_Functions ImGuiImplVulkanFuncs; static ImGui_ImplVulkan_Functions& ImGui_ImplVulkan_GetFunctions(); -// Define a wrapper around each Vulkan function pointer to properly dispatch it +// Wrap each Vulkan function pointer to properly dispatch it using the current backend data #define IMGUI_VULKAN_FUNC_WRAPPER(func) \ template \ auto func(Args&&... args) { \ @@ -1526,8 +1527,6 @@ void ImGui_ImplVulkan_RemoveTexture(VkDescriptorSet descriptor_set) void ImGui_ImplVulkan_DestroyFrameRenderBuffers(VkDevice device, ImGui_ImplVulkan_FrameRenderBuffers* buffers, const VkAllocationCallbacks* allocator) { - ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData(); - IM_UNUSED(bd); // May be unused if (buffers->VertexBuffer) { vkDestroyBuffer(device, buffers->VertexBuffer, allocator); buffers->VertexBuffer = VK_NULL_HANDLE; } if (buffers->VertexBufferMemory) { vkFreeMemory(device, buffers->VertexBufferMemory, allocator); buffers->VertexBufferMemory = VK_NULL_HANDLE; } if (buffers->IndexBuffer) { vkDestroyBuffer(device, buffers->IndexBuffer, allocator); buffers->IndexBuffer = VK_NULL_HANDLE; }