When can I free resources and structures passed to a vulkan vkCreateXXX function?

前端 未结 1 1990
一生所求
一生所求 2020-12-21 09:00

I\'m starting to learn Vulkan, and want to know if VkCreate[...] functions copy the resources pointed in structs into his own buffers.

To clarify my question, in thi

相关标签:
1条回答
  • 2020-12-21 09:38

    See Object Lifetime of the Vulkan specification.

    The ownership of application-owned memory is immediately acquired by any Vulkan command it is passed into. Ownership of such memory must be released back to the application at the end of the duration of the command, so that the application can alter or free this memory as soon as all the commands that acquired it have returned.

    In other words, anything you allocate you are free to delete as soon as a Vulkan function call returns. Additionally, once you've created your pipeline, you're free to destroy the VkShaderModule too.

    0 讨论(0)
提交回复
热议问题