## C Specification

To set the state of an event to signaled from a device, call:

// Provided by VK_VERSION_1_0
void vkCmdSetEvent(
VkCommandBuffer                             commandBuffer,
VkEvent                                     event,
VkPipelineStageFlags                        stageMask);

## Parameters

• commandBuffer is the command buffer into which the command is recorded.

• event is the event that will be signaled.

• stageMask specifies the source stage mask used to determine the first synchronization scope.

## Description

vkCmdSetEvent behaves identically to vkCmdSetEvent2KHR, except that it does not define an access scope, and must only be used with vkCmdWaitEvents, not vkCmdWaitEvents2KHR.

Valid Usage
If the geometry shaders feature is not enabled, stageMask must not contain VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT

If the tessellation shaders feature is not enabled, stageMask must not contain VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT

If the conditional rendering feature is not enabled, stageMask must not contain VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT

If the fragment density map feature is not enabled, stageMask must not contain VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT

If the transform feedback feature is not enabled, stageMask must not contain VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT

If the mesh shaders feature is not enabled, stageMask must not contain VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV

If the task shaders feature is not enabled, stageMask must not contain VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV

If the shading rate image feature is not enabled, stageMask must not contain VK_PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV

Any pipeline stage included in stageMask must be supported by the capabilities of the queue family specified by the queueFamilyIndex member of the VkCommandPoolCreateInfo structure that was used to create the VkCommandPool that commandBuffer was allocated from, as specified in the table of supported pipeline stages

If the synchronization2 feature is not enabled, stageMask must not be 0

stageMask must not include VK_PIPELINE_STAGE_HOST_BIT

• VUID-vkCmdSetEvent-commandBuffer-01152
commandBuffer’s current device mask must include exactly one physical device

Valid Usage (Implicit)
• VUID-vkCmdSetEvent-commandBuffer-parameter
commandBuffer must be a valid VkCommandBuffer handle

• VUID-vkCmdSetEvent-event-parameter
event must be a valid VkEvent handle

stageMask must be a valid combination of VkPipelineStageFlagBits values

stageMask must not be 0

• VUID-vkCmdSetEvent-commandBuffer-recording
commandBuffer must be in the recording state

• VUID-vkCmdSetEvent-commandBuffer-cmdpool
The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations

• VUID-vkCmdSetEvent-renderpass
This command must only be called outside of a render pass instance

• VUID-vkCmdSetEvent-commonparent
Both of commandBuffer, and event must have been created, allocated, or retrieved from the same VkDevice

Host Synchronization
• Host access to commandBuffer must be externally synchronized

• Host access to the VkCommandPool that commandBuffer was allocated from must be externally synchronized

Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type

Primary
Secondary

Outside

Graphics
Compute