I have the following scenario in mind and I don't know if it is valid:
- Create a
VkCommandPoolat the beginning of the program and allocate a singleVkCommandBufferfrom it. - In the render loop, record commands to the
VkCommandBuffer(implicitly resetting it) referencing theVkFramebufferappropriate for the currentVkImageViewfrom theVkSwapchain. - Submit the command buffer
I am not sure if I can reset the command buffer and rerecord it immediately on the next frame after it has just been submitted for execution. Is this defined behavior and does it allow multiple frames in flight, or is it flawed in some way?
On one hand, it seems that this should be valid as after being submitted, the commands were copied to the GPU, but on the other hand, after seeing the flag VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT it seems like by default command buffers cannot be submitted while they are already "pending".
I think this problem can be generalized to multiple command buffers and whether each of them should have as many copies there are vkImages in the vkSwapchain or a single one would suffice.