Top Description Fields Constructors Methods
org.lwjgl.vulkan

public Class KHRSynchronization2

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.system.*

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:

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

VK_KHR_synchronization2
Name String
VK_KHR_synchronization2
Extension Type
Device extension
Registered Extension Number
315
Revision
1
Extension and Version Dependencies
VK_KHR_get_physical_device_properties2 or Version 1.1
Deprecation state
Contact
Other Extension Metadata
Last Modified Date
2020-12-03
Interactions and External Dependencies
Contributors
  • Tobias Hector

Field Summary

Modifier and TypeField and Description
public static final long
public static final long
public static final long
public static final long
public static final long
public static final long
public static final long
public static final long
public static final long
public static final long
public static final long
public static final long
public static final long
public static final long
public static final long
VK_ACCESS_2_HOST_READ_BIT_KHR

Extends VkAccessFlagBits2.

public static final long
VK_ACCESS_2_HOST_WRITE_BIT_KHR

Extends VkAccessFlagBits2.

public static final long
VK_ACCESS_2_INDEX_READ_BIT_KHR

Extends VkAccessFlagBits2.

public static final long
public static final long
public static final long
VK_ACCESS_2_MEMORY_READ_BIT_KHR

Extends VkAccessFlagBits2.

public static final long
VK_ACCESS_2_MEMORY_WRITE_BIT_KHR

Extends VkAccessFlagBits2.

public static final long
VK_ACCESS_2_NONE_KHR

Extends VkAccessFlagBits2.

public static final long
VK_ACCESS_2_SHADER_READ_BIT_KHR

Extends VkAccessFlagBits2.

public static final long
VK_ACCESS_2_SHADER_SAMPLED_READ_BIT_KHR

Extends VkAccessFlagBits2.

public static final long
VK_ACCESS_2_SHADER_STORAGE_READ_BIT_KHR

Extends VkAccessFlagBits2.

public static final long
VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT_KHR

Extends VkAccessFlagBits2.

public static final long
VK_ACCESS_2_SHADER_WRITE_BIT_KHR

Extends VkAccessFlagBits2.

public static final long
public static final long
VK_ACCESS_2_TRANSFER_READ_BIT_KHR

Extends VkAccessFlagBits2.

public static final long
VK_ACCESS_2_TRANSFER_WRITE_BIT_KHR

Extends VkAccessFlagBits2.

public static final long
public static final long
public static final long
public static final long
VK_ACCESS_2_UNIFORM_READ_BIT_KHR

Extends VkAccessFlagBits2.

public static final long
public static final int
VK_ACCESS_NONE_KHR

Extends VkAccessFlagBits.

public static final int
VK_EVENT_CREATE_DEVICE_ONLY_BIT_KHR

Extends VkEventCreateFlagBits.

public static final int
public static final int
public static final String
public static final int
VK_KHR_SYNCHRONIZATION_2_SPEC_VERSION

The extension specification version.

public static final long
public static final long
public static final long
VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_BLIT_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_CLEAR_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_NV

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_COPY_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
public static final long
VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
public static final long
VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_HOST_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_EXT

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_NV

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_NONE_KHR

Extends VkPipelineStageFlagBits2.

public static final long
public static final long
VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_NV

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_RESOLVE_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_SHADING_RATE_IMAGE_BIT_NV

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_EXT

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_NV

Extends VkPipelineStageFlagBits2.

public static final long
public static final long
public static final long
VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_TRANSFER_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final long
VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT_KHR

Extends VkPipelineStageFlagBits2.

public static final int
VK_PIPELINE_STAGE_NONE_KHR

Extends VkPipelineStageFlagBits.

public static final int
public static final int
public static final int
public static final int
VK_STRUCTURE_TYPE_DEPENDENCY_INFO_KHR

Extends VkStructureType.

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
VK_STRUCTURE_TYPE_SUBMIT_INFO_2_KHR

Extends VkStructureType.

public static final int
VK_SUBMIT_PROTECTED_BIT_KHR

Extends VkSubmitFlagBits.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static void
nvkCmdPipelineBarrier2KHR(VkCommandBuffer commandBuffer, long pDependencyInfo)

Unsafe version of: CmdPipelineBarrier2KHR

public static void
nvkCmdSetEvent2KHR(VkCommandBuffer commandBuffer, long event, long pDependencyInfo)

Unsafe version of: CmdSetEvent2KHR

public static void
nvkCmdWaitEvents2KHR(VkCommandBuffer commandBuffer, int
the length of the pEvents array.
eventCount
,
long pEvents, long pDependencyInfos)

Unsafe version of: CmdWaitEvents2KHR

public static void
nvkGetQueueCheckpointData2NV(VkQueue queue, long
a pointer to an integer related to the number of checkpoint markers available or queried, as described below.
pCheckpointDataCount
,
long pCheckpointData)

Unsafe version of: GetQueueCheckpointData2NV

public static int
nvkQueueSubmit2KHR(VkQueue queue, int
the number of elements in the pSubmits array.
submitCount
,
long pSubmits, long fence)

Unsafe version of: QueueSubmit2KHR

public static void
vkCmdPipelineBarrier2KHR(VkCommandBuffer
the command buffer into which the command is recorded.
commandBuffer
,
VkDependencyInfo
a pointer to a VkDependencyInfo structure defining the scopes of this operation.
pDependencyInfo
)

See CmdPipelineBarrier2.

public static void
vkCmdResetEvent2KHR(VkCommandBuffer
the command buffer into which the command is recorded.
commandBuffer
,
long
the event that will be unsignaled.
event
,
long
a VkPipelineStageFlags2 mask of pipeline stages used to determine the first synchronization scope.
stageMask
)

See CmdResetEvent2.

public static void
vkCmdSetEvent2KHR(VkCommandBuffer
the command buffer into which the command is recorded.
commandBuffer
,
long
the event that will be signaled.
event
,
VkDependencyInfo
a pointer to a VkDependencyInfo structure defining the first scopes of this operation.
pDependencyInfo
)

See CmdSetEvent2.

public static void
vkCmdWaitEvents2KHR(VkCommandBuffer
the command buffer into which the command is recorded.
commandBuffer
,
LongBuffer
a pointer to an array of eventCount events to wait on.
pEvents
,
VkDependencyInfo.Buffer
a pointer to an array of eventCount VkDependencyInfo structures, defining the second synchronization scope.
pDependencyInfos
)

See CmdWaitEvents2.

public static void
vkCmdWaitEvents2KHR(VkCommandBuffer commandBuffer, long[] pEvents, VkDependencyInfo.Buffer pDependencyInfos)

Array version of: CmdWaitEvents2KHR

public static void
vkCmdWriteBufferMarker2AMD(VkCommandBuffer
the command buffer into which the command will be recorded.
commandBuffer
,
long
specifies the pipeline stage whose completion triggers the marker write.
stage
,
long
the buffer where the marker will be written.
dstBuffer
,
long
the byte offset into the buffer where the marker will be written.
dstOffset
,
int
the 32-bit value of the marker.
marker
)

Execute a pipelined write of a marker value into a buffer.

public static void
vkCmdWriteTimestamp2KHR(VkCommandBuffer
the command buffer into which the command will be recorded.
commandBuffer
,
long
specifies a stage of the pipeline.
stage
,
long
the query pool that will manage the timestamp.
queryPool
,
int
the query within the query pool that will contain the timestamp.
query
)

See CmdWriteTimestamp2.

public static void
vkGetQueueCheckpointData2NV(VkQueue
the VkQueue object the caller would like to retrieve checkpoint data for
queue
,
IntBuffer
a pointer to an integer related to the number of checkpoint markers available or queried, as described below.
pCheckpointDataCount
,
VkCheckpointData2NV.Buffer
either NULL or a pointer to an array of VkCheckpointData2NV structures.
pCheckpointData
)

Retrieve diagnostic checkpoint data.

public static void
vkGetQueueCheckpointData2NV(VkQueue queue, int[] pCheckpointDataCount, VkCheckpointData2NV.Buffer pCheckpointData)

Array version of: GetQueueCheckpointData2NV

public static int
vkQueueSubmit2KHR(VkQueue
the queue that the command buffers will be submitted to.
queue
,
VkSubmitInfo2.Buffer
a pointer to an array of VkSubmitInfo2 structures, each specifying a command buffer submission batch.
pSubmits
,
long
an optional handle to a fence to be signaled once all submitted command buffers have completed execution. If fence is not NULL_HANDLE, it defines a fence signal operation.
fence
)

See QueueSubmit2.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait