Submitting command buffers to a queue
We have recorded command buffers and we want to harness the graphics hardware's power to process the prepared operations. What to do next? We need to submit prepared work to a selected queue.
Getting ready
In this recipe we will use variables of a custom WaitSemaphoreInfo
type. It is defined as follows:
struct WaitSemaphoreInfo { VkSemaphore Semaphore; VkPipelineStageFlags WaitingStage; };
Through it, we provide a handle of a semaphore on which hardware should wait before processing the given command buffer
, and we also specify in which pipeline stages the wait should occur.
How to do it...
- Take the handle of a queue to which work should be submitted. Use the handle to initialize a variable of type
VkQueue
namedqueue
. - Create a variable of type
std::vector<VkSemaphore>
namedwait_semaphore_handles
. If submitted commands should wait for other commands to end, in the variable store the handles of all semaphores for which a given queue...