Increasing the performance through increasing the number of separately rendered frames
Rendering a single frame of animation and submitting it to a queue is the goal of 3D graphics applications, such as games and benchmarks. But a single frame isn't enough. We want to render and display multiple frames or we won't achieve the effect of animation.
Unfortunately, we can't re-record the same command buffer immediately after we submit it; we must wait until the queue stops processing it. But, waiting until the command buffer processing is finished is a waste of time and it hurts the performance of our application. That's why we should render multiple frames of animation independently.
Getting ready
For the purpose of this recipe, we will use variables of a custom FrameResources
type. It has the following definition:
struct FrameResources { VkCommandBuffer CommandBuffer; VkDestroyer<VkSemaphore> ImageAcquiredSemaphore; VkDestroyer<VkSemaphore> ReadyToPresentSemaphore...