Open Archie3d opened 4 months ago
@Archie3d is this something you can provide an example to reproduce?
@axsaucedo Any example that uses push or specialization constants leaks memory. Freeing these explicitly in Algorithm::destroy()
fixes this issue (see https://github.com/Archie3d/kompute/commit/5a564a148ef0771764ba228769715102458e203a)
The commented code says that "vk::CommandBuffer
frees the data", but this is not the case. vkCmdPushConstants does not mention anything about retaining the data pointer, and actually I don't think Vulkan ever retains any data pointer passed to it (please see this comment).
Running on Windows with MSVC, I am getting memory leak reports because of
Algorithm::destroy
not not freeing push and specialization constants. The comment says that they are supposed to be freed by the command buffer destructor, but I am not sure this is the case. When freeing them explicitly here like in the commented code, I don't get memory leaks from using constants anymore.