SPIR-V Built-In

LaunchIdKHR

Launch Id for ray shaders
LaunchIdKHR

A variable decorated with the LaunchIdKHR decoration will specify the index of the work item being processed. One work item is generated for each of the width × height × depth items dispatched by a vkCmdTraceRaysKHR command. All shader invocations inherit the same value for variables decorated with LaunchIdKHR.

Valid Usage

VUID-LaunchIdKHR-LaunchIdKHR-04266

The LaunchIdKHR decoration must be used only within the RayGenerationKHR, IntersectionKHR, AnyHitKHR, ClosestHitKHR, MissKHR, or CallableKHR Execution Model

VUID-LaunchIdKHR-LaunchIdKHR-04267

The variable decorated with LaunchIdKHR must be declared using the Input Storage Class

VUID-LaunchIdKHR-LaunchIdKHR-04268

The variable decorated with LaunchIdKHR must be declared as a three-component vector of 32-bit integer values