Added ClearCache function to clear ImGui Vulkan texture cache on shutdown

docking
TheCherno 4 years ago
parent 53baeee26a
commit 60a35bfb25

@ -842,6 +842,8 @@ void ImGui_ImplVulkan_Shutdown()
// Clean up windows // Clean up windows
ImGui_ImplVulkan_ShutdownPlatformInterface(); ImGui_ImplVulkan_ShutdownPlatformInterface();
ImGui_ImplVulkan_ClearCache();
} }
void ImGui_ImplVulkan_NewFrame() void ImGui_ImplVulkan_NewFrame()
@ -1298,6 +1300,11 @@ ImTextureID ImGui_ImplVulkan_UpdateTextureInfo(VkDescriptorSet descriptorSet, Vk
return (ImTextureID)descriptorSet; return (ImTextureID)descriptorSet;
} }
void ImGui_ImplVulkan_ClearCache()
{
s_VulkanCache.clear();
}
void ImGui_ImplVulkanH_DestroyAllViewportsRenderBuffers(VkDevice device, const VkAllocationCallbacks* allocator) void ImGui_ImplVulkanH_DestroyAllViewportsRenderBuffers(VkDevice device, const VkAllocationCallbacks* allocator)
{ {
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO(); ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();

@ -51,6 +51,7 @@ IMGUI_IMPL_API void ImGui_ImplVulkan_DestroyFontUploadObjects();
IMGUI_IMPL_API void ImGui_ImplVulkan_SetMinImageCount(uint32_t min_image_count); // To override MinImageCount after initialization (e.g. if swap chain is recreated) IMGUI_IMPL_API void ImGui_ImplVulkan_SetMinImageCount(uint32_t min_image_count); // To override MinImageCount after initialization (e.g. if swap chain is recreated)
IMGUI_IMPL_API ImTextureID ImGui_ImplVulkan_AddTexture(VkSampler sampler, VkImageView image_view, VkImageLayout image_layout); IMGUI_IMPL_API ImTextureID ImGui_ImplVulkan_AddTexture(VkSampler sampler, VkImageView image_view, VkImageLayout image_layout);
IMGUI_IMPL_API ImTextureID ImGui_ImplVulkan_UpdateTextureInfo(VkDescriptorSet descriptorSet, VkSampler sampler, VkImageView image_view, VkImageLayout image_layout); IMGUI_IMPL_API ImTextureID ImGui_ImplVulkan_UpdateTextureInfo(VkDescriptorSet descriptorSet, VkSampler sampler, VkImageView image_view, VkImageLayout image_layout);
IMGUI_IMPL_API void ImGui_ImplVulkan_ClearCache();
//------------------------------------------------------------------------- //-------------------------------------------------------------------------

Loading…
Cancel
Save