in vulkan when recreating the swapchain. do i also need to free the command buffers or…
- User
in vulkan when recreating the swapchain. do i also need to free the command buffers or can i reuse them?
Assistant
In Vulkan, when recreating the swapchain, you do not need to free the command buffers. The command buffers are owned by the graphics engine and are not part of the swapchain.
When you create a swapchain, you provide a set of command buffers to the
vkCreateSwapchainKHRfunction, which are used to render the frames for the swapchain. These command buffers are stored in the swapchain and are reused for each frame.When you need to recreate the swapchain, you can simply destroy the old swapchain and create a new one with the same or different command buffers. The command buffers that you provided to the
vkCreateSwapchainKHRfunction are not affected by the recreation of the swapchain, and you can continue to use them to render frames for the new swapchain.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.