Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Name
VK_KHR_synchronization2 - device extension
VK_KHR_synchronization2
- Name String
VK_KHR_synchronization2
- Extension Type
- Device extension
- Registered Extension Number
- 315
- Revision
- 1
- Ratification Status
- Ratified
- Extension and Version Dependencies
- VK_KHR_get_physical_device_properties2 or Version 1.1
- Deprecation State
- Promoted to Vulkan 1.3
- Contact
Other Extension Metadata
- Last Modified Date
- 2020-12-03
- Interactions and External Dependencies
- Promoted to Vulkan 1.3 Core
- Interacts with
VK_KHR_create_renderpass2
- Contributors
- Tobias Hector
Description
This extension modifies the original core synchronization APIs to simplify the interface and improve usability of these APIs. It also adds new pipeline stage and access flag types that extend into the 64-bit range, as we have run out within the 32-bit range. The new flags are identical to the old values within the 32-bit range, with new stages and bits beyond that.
Pipeline stages and access flags are now specified together in memory
barrier structures, making the connection between the two more obvious.
Additionally, scoping the pipeline stages into the barrier structs
allows the use of the MEMORY_READ
and MEMORY_WRITE
flags without
sacrificing precision. The per-stage access flags should be used to
disambiguate specific accesses in a given stage or set of stages - for
instance, between uniform reads and sampling operations.
Layout transitions have been simplified as well; rather than requiring a
different set of layouts for depth/stencil/color attachments, there
are generic IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR
and
IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR
layouts which are contextually
applied based on the image format. For example, for a depth format
image, IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR
is equivalent to
IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL_KHR
.
IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR
also functionally replaces
IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
.
Events are now more efficient, because they include memory dependency information when you set them on the device. Previously, this information was only known when waiting on an event, so the dependencies could not be satisfied until the wait occurred. That sometimes meant stalling the pipeline when the wait occurred. The new API provides enough information for implementations to satisfy these dependencies in parallel with other tasks.
Queue submission has been changed to wrap command buffers and semaphores
in extensible structures, which incorporate changes from Vulkan 1.1,
VK_KHR_device_group
, and VK_KHR_timeline_semaphore
. This also adds a
pipeline stage to the semaphore signal operation, mirroring the existing
pipeline stage specification for wait operations.
Other miscellaneous changes include:
- Events can now be specified as interacting only with the device, allowing more efficient access to the underlying object.
Image memory barriers that do not perform an image layout transition can be specified by setting
oldLayout
equal tonewLayout
.- E.g. the old and new layout can both be set to
IMAGE_LAYOUT_UNDEFINED
, without discarding data in the image.
- E.g. the old and new layout can both be set to
- Queue family ownership transfer parameters are simplified in some cases.
- Where two synchronization commands need to be matched up (queue transfer operations, events), the dependency information specified in each place must now match completely for consistency.
- Extensions with commands or functions with a
PipelineStageFlags
orPipelineStageFlagBits
parameter have had those APIs replaced with equivalents usingPipelineStageFlags2KHR
. - The new event and barrier interfaces are now more extensible for future changes.
- Relevant pipeline stage masks can now be specified as empty with the
new
PIPELINE_STAGE_NONE_KHR
andPIPELINE_STAGE_2_NONE_KHR
values. MemoryBarrier2KHR
can be chained toSubpassDependency2
, overriding the original 32-bit stage and access masks.
New Base Types
New Commands
If VK_AMD_buffer_marker is supported:
If VK_NV_device_diagnostic_checkpoints is supported:
New Structures
CommandBufferSubmitInfoKHR
DependencyInfoKHR
ImageMemoryBarrier2KHR
SemaphoreSubmitInfoKHR
SubmitInfo2KHR
Extending
PhysicalDeviceFeatures2
,DeviceCreateInfo
:Extending
SubpassDependency2
:
If VK_NV_device_diagnostic_checkpoints is supported:
New Enums
New Bitmasks
New Enum Constants
KHR_SYNCHRONIZATION_2_SPEC_VERSION
Extending
AccessFlagBits
:Extending
EventCreateFlagBits
:Extending
ImageLayout
:Extending
PipelineStageFlagBits
:Extending
StructureType
:STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2_KHR
STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO_KHR
STRUCTURE_TYPE_DEPENDENCY_INFO_KHR
STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2_KHR
STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR
STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR
STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO_KHR
STRUCTURE_TYPE_SUBMIT_INFO_2_KHR
If VK_EXT_blend_operation_advanced is supported:
If VK_EXT_conditional_rendering is supported:
Extending
AccessFlagBits2
:Extending
PipelineStageFlagBits2
:
If VK_EXT_fragment_density_map is supported:
Extending
AccessFlagBits2
:Extending
PipelineStageFlagBits2
:
If VK_EXT_mesh_shader is supported:
Extending
PipelineStageFlagBits2
:
If VK_EXT_transform_feedback is supported:
Extending
AccessFlagBits2
:Extending
PipelineStageFlagBits2
:
If VK_KHR_acceleration_structure is supported:
Extending
AccessFlagBits2
:Extending
PipelineStageFlagBits2
:
If VK_KHR_fragment_shading_rate is supported:
Extending
AccessFlagBits2
:Extending
PipelineStageFlagBits2
:
If VK_KHR_ray_tracing_pipeline is supported:
If VK_NV_device_diagnostic_checkpoints is supported:
Extending
StructureType
:
If VK_NV_device_generated_commands is supported:
Extending
AccessFlagBits2
:Extending
PipelineStageFlagBits2
:
If VK_NV_mesh_shader is supported:
Extending
PipelineStageFlagBits2
:
If VK_NV_ray_tracing is supported:
Extending
AccessFlagBits2
:Extending
PipelineStageFlagBits2
:
If VK_NV_shading_rate_image is supported:
Extending
AccessFlagBits2
:Extending
PipelineStageFlagBits2
:
Promotion to Vulkan 1.3
Functionality in this extension is included in core Vulkan 1.3, with the KHR suffix omitted. The original type, enum and command names are still available as aliases of the core functionality.
Examples
See https://github.com/KhronosGroup/Vulkan-Docs/wiki/Synchronization-Examples
Version History
Revision 1, 2020-12-03 (Tobias Hector)
- Internal revisions
See Also
AccessFlagBits2KHR
, AccessFlags2KHR
, BufferMemoryBarrier2KHR
,
CommandBufferSubmitInfoKHR
, DependencyInfoKHR
,
Flags64
, ImageMemoryBarrier2KHR
,
MemoryBarrier2KHR
, PhysicalDeviceSynchronization2FeaturesKHR
,
PipelineStageFlagBits2KHR
, PipelineStageFlags2KHR
,
SemaphoreSubmitInfoKHR
, SubmitFlagBitsKHR
, SubmitFlagsKHR
,
SubmitInfo2KHR
, cmdPipelineBarrier2KHR
, cmdResetEvent2KHR
,
cmdSetEvent2KHR
, cmdWaitEvents2KHR
, cmdWriteTimestamp2KHR
,
queueSubmit2KHR
Document Notes
For more information, see the Vulkan Specification
This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.
Synopsis
- cmdWriteBufferMarker2AMD :: forall io. MonadIO io => CommandBuffer -> PipelineStageFlags2 -> ("dstBuffer" ::: Buffer) -> ("dstOffset" ::: DeviceSize) -> ("marker" ::: Word32) -> io ()
- getQueueCheckpointData2NV :: forall io. MonadIO io => Queue -> io ("checkpointData" ::: Vector CheckpointData2NV)
- pattern STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR :: StructureType
- pattern STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2_KHR :: StructureType
- pattern STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2_KHR :: StructureType
- pattern STRUCTURE_TYPE_DEPENDENCY_INFO_KHR :: StructureType
- pattern STRUCTURE_TYPE_SUBMIT_INFO_2_KHR :: StructureType
- pattern STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO_KHR :: StructureType
- pattern STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO_KHR :: StructureType
- pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR :: StructureType
- pattern EVENT_CREATE_DEVICE_ONLY_BIT_KHR :: EventCreateFlagBits
- pattern IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR :: ImageLayout
- pattern IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR :: ImageLayout
- pattern PIPELINE_STAGE_NONE_KHR :: PipelineStageFlagBits
- pattern ACCESS_NONE_KHR :: AccessFlagBits
- pattern PIPELINE_STAGE_2_SHADING_RATE_IMAGE_BIT_NV :: PipelineStageFlagBits2
- pattern ACCESS_2_SHADING_RATE_IMAGE_READ_BIT_NV :: AccessFlagBits2
- pattern PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_NV :: PipelineStageFlagBits2
- pattern PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_NV :: PipelineStageFlagBits2
- pattern ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_NV :: AccessFlagBits2
- pattern ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_NV :: AccessFlagBits2
- pattern PIPELINE_STAGE_2_TASK_SHADER_BIT_NV :: PipelineStageFlagBits2
- pattern PIPELINE_STAGE_2_MESH_SHADER_BIT_NV :: PipelineStageFlagBits2
- cmdSetEvent2KHR :: MonadIO io => CommandBuffer -> Event -> DependencyInfo -> io ()
- cmdResetEvent2KHR :: MonadIO io => CommandBuffer -> Event -> ("stageMask" ::: PipelineStageFlags2) -> io ()
- cmdWaitEvents2KHR :: MonadIO io => CommandBuffer -> ("events" ::: Vector Event) -> ("dependencyInfos" ::: Vector DependencyInfo) -> io ()
- cmdPipelineBarrier2KHR :: MonadIO io => CommandBuffer -> DependencyInfo -> io ()
- queueSubmit2KHR :: MonadIO io => Queue -> ("submits" ::: Vector (SomeStruct SubmitInfo2)) -> Fence -> io ()
- cmdWriteTimestamp2KHR :: MonadIO io => CommandBuffer -> PipelineStageFlags2 -> QueryPool -> ("query" ::: Word32) -> io ()
- data QueueFamilyCheckpointProperties2NV = QueueFamilyCheckpointProperties2NV {}
- data CheckpointData2NV = CheckpointData2NV {
- stage :: PipelineStageFlags2
- checkpointMarker :: Ptr ()
- type AccessFlags2KHR = AccessFlags2
- type PipelineStageFlags2KHR = PipelineStageFlags2
- type SubmitFlagsKHR = SubmitFlags
- type AccessFlagBits2KHR = AccessFlagBits2
- type PipelineStageFlagBits2KHR = PipelineStageFlagBits2
- type SubmitFlagBitsKHR = SubmitFlagBits
- type MemoryBarrier2KHR = MemoryBarrier2
- type ImageMemoryBarrier2KHR = ImageMemoryBarrier2
- type BufferMemoryBarrier2KHR = BufferMemoryBarrier2
- type DependencyInfoKHR = DependencyInfo
- type SemaphoreSubmitInfoKHR = SemaphoreSubmitInfo
- type CommandBufferSubmitInfoKHR = CommandBufferSubmitInfo
- type SubmitInfo2KHR = SubmitInfo2
- type PhysicalDeviceSynchronization2FeaturesKHR = PhysicalDeviceSynchronization2Features
- type KHR_SYNCHRONIZATION_2_SPEC_VERSION = 1
- pattern KHR_SYNCHRONIZATION_2_SPEC_VERSION :: forall a. Integral a => a
- type KHR_SYNCHRONIZATION_2_EXTENSION_NAME = "VK_KHR_synchronization2"
- pattern KHR_SYNCHRONIZATION_2_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
Documentation
cmdWriteBufferMarker2AMD Source #
:: forall io. MonadIO io | |
=> CommandBuffer |
|
-> PipelineStageFlags2 |
|
-> ("dstBuffer" ::: Buffer) |
|
-> ("dstOffset" ::: DeviceSize) |
|
-> ("marker" ::: Word32) |
|
-> io () |
vkCmdWriteBufferMarker2AMD - Execute a pipelined write of a marker value into a buffer
Description
The command will write the 32-bit marker value into the buffer only
after all preceding commands have finished executing up to at least the
specified pipeline stage. This includes the completion of other
preceding cmdWriteBufferMarker2AMD
commands so long as their specified
pipeline stages occur either at the same time or earlier than this
command’s specified stage
.
While consecutive buffer marker writes with the same stage
parameter
implicitly complete in submission order, memory and execution
dependencies between buffer marker writes and other operations must
still be explicitly ordered using synchronization commands. The access
scope for buffer marker writes falls under the
ACCESS_TRANSFER_WRITE_BIT
, and the
pipeline stages for identifying the synchronization scope must include
both stage
and
PIPELINE_STAGE_TRANSFER_BIT
.
Note
Similar to
cmdWriteTimestamp2
,
if an implementation is unable to write a marker at any specific
pipeline stage, it may instead do so at any logically later stage.
Note
Implementations may only support a limited number of pipelined marker write operations in flight at a given time. Thus an excessive number of marker write operations may degrade command execution performance.
Valid Usage
- If the
geometryShader
feature is not enabled,
stage
must not containPIPELINE_STAGE_2_GEOMETRY_SHADER_BIT
- If the
tessellationShader
feature is not enabled,
stage
must not containPIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT
orPIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT
- If the
conditionalRendering
feature is not enabled,
stage
must not containPIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT
- If the
fragmentDensityMap
feature is not enabled,
stage
must not containPIPELINE_STAGE_2_FRAGMENT_DENSITY_PROCESS_BIT_EXT
- If the
transformFeedback
feature is not enabled,
stage
must not containPIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT
- If the
meshShader
feature is not enabled,
stage
must not containPIPELINE_STAGE_2_MESH_SHADER_BIT_EXT
- If the
taskShader
feature is not enabled,
stage
must not containPIPELINE_STAGE_2_TASK_SHADER_BIT_EXT
- If neither the
shadingRateImage
or
attachmentFragmentShadingRate
are enabled,
stage
must not containPIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR
- If the
subpassShading
feature is not enabled,
stage
must not containPIPELINE_STAGE_2_SUBPASS_SHADER_BIT_HUAWEI
- If the
invocationMask
feature is not enabled,
stage
must not containPIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI
- If neither the
VK_NV_ray_tracing
extension or
rayTracingPipeline feature
are enabled,
stage
must not containPIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR
- The synchronization2 feature must be enabled
-
stage
must include only a single pipeline stage -
stage
must include only stages that are valid for the queue family that was used to create the command pool thatcommandBuffer
was allocated from -
dstOffset
must be less than or equal to the size ofdstBuffer
minus4
-
dstBuffer
must have been created with theBUFFER_USAGE_TRANSFER_DST_BIT
usage flag - If
dstBuffer
is non-sparse then it must be bound completely and contiguously to a singleDeviceMemory
object -
dstOffset
must be a multiple of4
Valid Usage (Implicit)
-
commandBuffer
must be a validCommandBuffer
handle
-
stage
must be a valid combination ofPipelineStageFlagBits2
values -
dstBuffer
must be a validBuffer
handle -
commandBuffer
must be in the recording state - The
CommandPool
thatcommandBuffer
was allocated from must support transfer, graphics, or compute operations - This command must only be called outside of a video coding scope
- Both of
commandBuffer
, anddstBuffer
must have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized
- Host access to the
CommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
'
Command Buffer Levels | Render Pass Scope | Video Coding Scope | Supported Queue Types | Command Type |
---|---|---|---|---|
Primary Secondary | Both | Outside | Transfer Graphics Compute | Action |
See Also
VK_AMD_buffer_marker,
VK_KHR_synchronization2,
Buffer
, CommandBuffer
,
DeviceSize
,
PipelineStageFlags2
getQueueCheckpointData2NV Source #
:: forall io. MonadIO io | |
=> Queue |
|
-> io ("checkpointData" ::: Vector CheckpointData2NV) |
vkGetQueueCheckpointData2NV - Retrieve diagnostic checkpoint data
Description
If pCheckpointData
is NULL
, then the number of checkpoint markers
available is returned in pCheckpointDataCount
. Otherwise,
pCheckpointDataCount
must point to a variable set by the user to the
number of elements in the pCheckpointData
array, and on return the
variable is overwritten with the number of structures actually written
to pCheckpointData
.
If pCheckpointDataCount
is less than the number of checkpoint markers
available, at most pCheckpointDataCount
structures will be written.
Valid Usage
Valid Usage (Implicit)
-
queue
must be a validQueue
handle
-
pCheckpointDataCount
must be a valid pointer to auint32_t
value - If the
value referenced by
pCheckpointDataCount
is not0
, andpCheckpointData
is notNULL
,pCheckpointData
must be a valid pointer to an array ofpCheckpointDataCount
CheckpointData2NV
structures
See Also
VK_KHR_synchronization2,
VK_NV_device_diagnostic_checkpoints,
CheckpointData2NV
, Queue
pattern STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR :: StructureType Source #
pattern STRUCTURE_TYPE_DEPENDENCY_INFO_KHR :: StructureType Source #
pattern STRUCTURE_TYPE_SUBMIT_INFO_2_KHR :: StructureType Source #
pattern IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR :: ImageLayout Source #
pattern IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR :: ImageLayout Source #
pattern PIPELINE_STAGE_NONE_KHR :: PipelineStageFlagBits Source #
pattern ACCESS_NONE_KHR :: AccessFlagBits Source #
cmdSetEvent2KHR :: MonadIO io => CommandBuffer -> Event -> DependencyInfo -> io () Source #
cmdResetEvent2KHR :: MonadIO io => CommandBuffer -> Event -> ("stageMask" ::: PipelineStageFlags2) -> io () Source #
cmdWaitEvents2KHR :: MonadIO io => CommandBuffer -> ("events" ::: Vector Event) -> ("dependencyInfos" ::: Vector DependencyInfo) -> io () Source #
cmdPipelineBarrier2KHR :: MonadIO io => CommandBuffer -> DependencyInfo -> io () Source #
queueSubmit2KHR :: MonadIO io => Queue -> ("submits" ::: Vector (SomeStruct SubmitInfo2)) -> Fence -> io () Source #
cmdWriteTimestamp2KHR :: MonadIO io => CommandBuffer -> PipelineStageFlags2 -> QueryPool -> ("query" ::: Word32) -> io () Source #
data QueueFamilyCheckpointProperties2NV Source #
VkQueueFamilyCheckpointProperties2NV - Return structure for queue family checkpoint information query
Description
Additional queue family information can be queried by setting
QueueFamilyProperties2
::pNext
to point to a QueueFamilyCheckpointProperties2NV
structure.
Valid Usage (Implicit)
See Also
VK_KHR_synchronization2,
VK_NV_device_diagnostic_checkpoints,
PipelineStageFlags2
,
StructureType
QueueFamilyCheckpointProperties2NV | |
|
Instances
data CheckpointData2NV Source #
VkCheckpointData2NV - Return structure for command buffer checkpoint data
Valid Usage (Implicit)
The stages at which a checkpoint marker can be executed are
implementation-defined and can be queried by calling
getPhysicalDeviceQueueFamilyProperties2
.
See Also
VK_KHR_synchronization2,
VK_NV_device_diagnostic_checkpoints,
PipelineStageFlags2
,
StructureType
,
getQueueCheckpointData2NV
CheckpointData2NV | |
|
Instances
type AccessFlags2KHR = AccessFlags2 Source #
type SubmitFlagsKHR = SubmitFlags Source #
type AccessFlagBits2KHR = AccessFlagBits2 Source #
type SubmitFlagBitsKHR = SubmitFlagBits Source #
type MemoryBarrier2KHR = MemoryBarrier2 Source #
type DependencyInfoKHR = DependencyInfo Source #
type SubmitInfo2KHR = SubmitInfo2 Source #
type KHR_SYNCHRONIZATION_2_SPEC_VERSION = 1 Source #
pattern KHR_SYNCHRONIZATION_2_SPEC_VERSION :: forall a. Integral a => a Source #
type KHR_SYNCHRONIZATION_2_EXTENSION_NAME = "VK_KHR_synchronization2" Source #
pattern KHR_SYNCHRONIZATION_2_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a Source #