Skip to content
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

Provide an API to free texture descritpors allocated by Vulkan backend #5738

Closed
azonenberg opened this issue Sep 30, 2022 · 3 comments
Closed

Comments

@azonenberg
Copy link
Contributor

Right now, there is an ImGui_ImplXXX_AddTexture function, but there doesn't appear to be a corresponding function to free a texture you don't need anymore without making raw platform API calls (e.g. vkFreeDescriptorSets) yourself.

@ocornut
Copy link
Owner

ocornut commented Oct 3, 2022

The ImGui_ImplVulkan_AddTexture() function is a peculiarity of the Vulkan backend (see #914) and is already close to being a raw platform API call.

Can you confirm that calling vkFreeDescriptorSets(g_Device, g_DescriptorPool, 1, &descriptor_set); would work and be enough here? We could potentially wrap it.

The function names are misleading and handling of ImTextureID for Vulkan may evolve.

@ocornut ocornut added the vulkan label Oct 3, 2022
@azonenberg
Copy link
Contributor Author

Yes, this is how I do things in my code now. It just seems weird to have one end wrapped and not the other.

@ocornut ocornut changed the title Feature request: Provide an API to free texture handles allocated by ImGui Provide an API to free texture descritpors allocated by Vulkan backend Oct 4, 2022
@ocornut
Copy link
Owner

ocornut commented Oct 4, 2022

Added a588f00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants