C Specification
To submit command buffers to a queue, call:
// Provided by VK_VERSION_1_3
VkResult vkQueueSubmit2(
VkQueue queue,
uint32_t submitCount,
const VkSubmitInfo2* pSubmits,
VkFence fence);
// Provided by VK_KHR_synchronization2
// Equivalent to vkQueueSubmit2
VkResult vkQueueSubmit2KHR(
VkQueue queue,
uint32_t submitCount,
const VkSubmitInfo2* pSubmits,
VkFence fence);
Parameters
-
queueis the queue that the command buffers will be submitted to. -
submitCountis the number of elements in thepSubmitsarray. -
pSubmitsis a pointer to an array of VkSubmitInfo2 structures, each specifying a command buffer submission batch. Command buffers and semaphores specified in this array may be accessed at any point until the queue operations they define complete execution on the device. -
fenceis an optional handle to a fence to be signaled once all submitted command buffers have completed execution. Iffenceis not VK_NULL_HANDLE, it defines a fence signal operation. If it is not VK_NULL_HANDLE,fencemay be accessed at any point until this command completes on the device.
Description
vkQueueSubmit2 is a queue submission
command, with each batch defined by an element of pSubmits.
The first synchronization scope of
each semaphore signal operation
defined by this command includes every command in the same batch that the
signal operation is defined in, and all commands that occur earlier in
submission order.
The scope is limited by the stageMask member of the
VkSemaphoreSubmitInfo used to define each such operation.
The second synchronization scope of
each semaphore wait operation defined
by this command includes every command in the same batch that the wait
operation is defined in, and all commands that occur later in
submission order.
The scope is limited by the stageMask member of the
VkSemaphoreSubmitInfo used to define each such operation.
If any command buffer submitted to this queue is in the executable state, it is moved to the pending state. Once execution of all submissions of a command buffer complete, it moves from the pending state, back to the executable state. If a command buffer was recorded with the VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT flag, it instead moves back to the invalid state.
If vkQueueSubmit2 fails, it may return
VK_ERROR_OUT_OF_HOST_MEMORY or VK_ERROR_OUT_OF_DEVICE_MEMORY.
If it does, the implementation must ensure that the state and contents of
any resources or synchronization primitives referenced by the submitted
command buffers and any semaphores referenced by pSubmits is
unaffected by the call or its failure.
If vkQueueSubmit2 fails in such a way that the implementation is
unable to make that guarantee, the implementation must return
VK_ERROR_DEVICE_LOST.
See Lost Device.
Document Notes
For more information, see the Vulkan Specification.
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.