Vulkan-Docs/doc/specs/vulkan/man/vkCmdWaitEvents.txt

139 lines
6.1 KiB
Plaintext

vkCmdWaitEvents(3)
==================
Name
----
vkCmdWaitEvents - Wait for one or more events and insert a set of memory
barriers.
C Specification
---------------
include::../protos/vkCmdWaitEvents.txt[]
Parameters
----------
pname:commandBuffer::
The command buffer in which to wait.
pname:eventCount::
Number of event objects to wait on.
pname:pEvents::
Array of pname:eventCount number of event objects to wait on.
pname:srcStageMask::
Mask of pipeline stages used to signal all of the events in pname:pEvents.
pname:dstStageMask::
Specifies which pipeline stages must wait for the events to become
signaled (see elink:VkPipelineStageFlags for more detail).
pname:memoryBarrierCount::
Number of memory barriers to insert after waiting for the events.
pname:ppMemoryBarriers::
Array of pointers to memory barrier structures specifying the parameters
of the memory barriers to insert after waiting for the events. Each
element of the array may point to a slink:VkMemoryBarrier,
slink:VkBufferMemoryBarrier, or slink:VkImageMemoryBarrier structure.
Description
-----------
fname:vkCmdWaitEvents waits for a number of event objects to become
signalled and inserts a set of memory barriers into the command buffer
specified by pname:commandBuffer.
fname:vkCmdWaitEvents waits for each of the pname:eventCount event object
specified by pname:pEvents to become signalled. The point at which each is
signalled must have been specified in the command that caused the object to
become signalled (either fname:vkSetEvent or fname:vkCmdSetEvent) and must
also have the corresponding bit set in pname:srcStageMask.
The pname:ppMemoryBarriers parameter is a pointer to an array of pname:memoryBarrierCount
structures defining the parameters of memory barriers to insert after waiting
for each of the events. Each element of the array may be an instance of
slink:VkMemoryBarrier, slink:VkBufferMemoryBarrier, or slink:VkImageMemoryBarrier,
the definitions of each are, respectively:
include::../structs/VkMemoryBarrier.txt[]
include::../structs/VkBufferMemoryBarrier.txt[]
include::../structs/VkImageMemoryBarrier.txt[]
The memory barriers specified by pname:ppMemoryBarriers cause writes as described by
pname:outputMask that were written by pipeline stages in pname:srcStageMask
prior to the wait to be made visible to reads as described by
pname:inputMask in pipeline stages in pname:dstStageMask subsequent to the
wait.
In case of global memory barriers inserted by passing an
slink:VkMemoryBarrier structure to the command prior writes in the requested
pipeline stages to any memory location corresponding to the set of memory
output coherency flags specified in the pname:outputMask member of the
structure are made coherent with subsequent reads in the requested pipeline
stages of any memory location corresponding to the set of memory input
coherency flags specified in the pname:inputMask member of the structure.
In case of buffer memory barriers inserted by passing an
slink:VkBufferMemoryBarrier structure to the command prior writes in the
requested pipeline stages to the specified sub-range of the buffer
corresponding to the set of memory output coherency flags specified in the
pname:outputMask member of the structure are made coherent with subsequent
reads in the requested pipeline stages of the specified sub-range of the
buffer corresponding to the set of memory input coherency flags specified in
the pname:inputMask member of the structure.
In case of image memory barriers inserted by passing an
slink:VkImageMemoryBarrier structure to the command prior writes in the
requested pipeline stages to the specified sub-range of the image
corresponding to the set of memory output coherency flags specified in the
pname:outputMask member of the structure are made coherent with subsequent
reads in the requested pipeline stages of the specified sub-range of the
image corresponding to the set of memory input coherency flags specified in
the pname:inputMask member of the structure. Additionally, if the
pname:oldLayout and pname:newLayout members of the structure don't match a
layout transition is performed on the specified sub-range of the image as
part of the memory barrier.
In case of buffer and image memory barriers the pname:srcQueueFamilyIndex
and pname:dstQueueFamilyIndex members of the corresponding memory barrier
structures can specify the parameters of a transfer of ownership between two
distinct families of queues of a shared buffer or image object created with
the ename:VK_SHARING_MODE_EXCLUSIVE sharing mode. In case of regular
resource transitions both pname:srcQueueFamilyIndex and
pname:dstQueueFamilyIndex should be set to ename:VK_QUEUE_FAMILY_IGNORED to
indicate no transfer of ownership between queue families. In case of
resource transitions involving ownership transfer of shared buffers or
images one of these two members have to match the queue family index the
command buffer specified by pname:commandBuffer was created for, while the other
should specify the queue family index the ownership transfer is released to
or acquired from. Ownership transferring resource transitions have to be
performed both on a queue from the source queue family and on a queue from
the destination queue family (see elink:VkSharingMode for more detail).
If pname:inputMask is zero in any of the memory barrier structures
then prior writes will only be coherent with any type of subsequent read
after a future resource transition command specifies a non-empty set of
memory input coherency control flags. This allows flushing device output
caches unconditionally.
If pname:outputMask is zero in any of the memory barrier
structures then subsequent reads will only be coherent with any type of
prior write if an earlier resource transition command specified a non-empty
set of memory output coherency control flags. This allows invalidating
device input caches unconditionally.
include::../validity/protos/vkCmdWaitEvents.txt[]
See Also
--------
flink:vkCmdSetEvent, flink:vkCmdResetEvent, flink:vkSetEvent, flink:vkResetEvent, flink:vkCmdPipelineBarrier,
slink:VkMemoryBarrier, slink:VkBufferMemoryBarrier, slink:VkImageMemoryBarrier, elink:VkPipelineStageFlagBits
include::footer.txt[]