InvocationId(3)

# InvocationId(3) Manual Page

## Name

InvocationId - Invocation ID in a geometry or tessellation control shader

Loading… please wait.

## Description

`InvocationId`

  Decorating a variable with the `InvocationId` built-in decoration will make that variable contain the index of the current shader invocation in a geometry shader, or the index of the output patch vertex in a tessellation control shader.

  In a geometry shader, the index of the current shader invocation ranges from zero to the number of instances declared in the shader minus one. If the instance count of the geometry shader is one or is not specified, then `InvocationId` will be zero.

Valid Usage

- VUID-InvocationId-InvocationId-04257
  The `InvocationId` decoration must be used only within the `TessellationControl` or `Geometry` `Execution` `Model`

- VUID-InvocationId-InvocationId-04258
  The variable decorated with `InvocationId` must be declared using the `Input` `Storage` `Class`

- VUID-InvocationId-InvocationId-04259
  The variable decorated with `InvocationId` must be declared as a scalar 32-bit integer value

## See Also

No cross-references are available

## Document Notes

For more information, see the Vulkan Specification

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.

## Copyright

Copyright 2014-2023 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0