-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ImGui_ImplVulkan_DestroyFontsTexture function #6327
Add ImGui_ImplVulkan_DestroyFontsTexture function #6327
Conversation
Hello, See resolutions for the main issue pushed here: #6943 (comment) However your PR has other remaining things:
(Edited) sorry submitted comment too fast. |
Hello, why deleting this? |
This PR contains a prototype implementation of
ImGui_ImplVulkan_DestroyFontsTexture
, which I recently noticed I needed for a project of my own. The absence ofImGui_ImplVulkan_DestroyFontsTexture
is discussed #4618, which requests proof-of-concepts for dynamic font reloading using the Vulkan backend. This PR aims to provide one such proof of concept.I've developed and tested this patch on an M1 Macbook running macOS Ventura 13.3.1, and a Windows 11 machine with an RTX 2070 SUPER GPU. This solution results in no validation layer errors or warnings when I've tested it locally (but I'm sure there are aspects that can be improved, just let me know).
Problem
Attempting to upload the fonts texture more than once is not possible with the Vulkan backend, since we cannot easily destroy the previous fonts texture. This makes font resizing problematic/impossible.
Changes
ImGui_ImplVulkan_DestroyFontsTexture
functionImGui_ImplVulkan_CreateFontsTexture
now checks for existing font resources and automatically callsImGui_ImplVulkan_DestroyFontsTexture
if necessary (this means that users don't need to callImGui_ImplVulkan_DestroyFontsTexture
themselves, so it could potentially be hidden, unless we provide it for consistency with other backends)ImGui_ImplVulkan_DestroyFontsTexture
andImGui_ImplVulkan_CreateFontsTexture
)VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME
macro is not defined with MoltenVK, use raw string insteadSee also