Description

LocalInvocationId

Decorating a variable with the LocalInvocationId built-in decoration will make that variable contain the location of the current compute shader invocation within the local workgroup. Each component ranges from zero through to the size of the workgroup in that dimension minus one.

Note

If the size of the workgroup in a particular dimension is one, then the LocalInvocationId in that dimension will be zero. If the workgroup is effectively two-dimensional, then LocalInvocationId.z will be zero. If the workgroup is effectively one-dimensional, then both LocalInvocationId.y and LocalInvocationId.z will be zero.

Valid Usage
  • VUID-LocalInvocationId-LocalInvocationId-04281
    The LocalInvocationId decoration must be used only within the GLCompute, MeshEXT, TaskEXT, MeshNV, or TaskNV Execution Model

  • VUID-LocalInvocationId-LocalInvocationId-04282
    The variable decorated with LocalInvocationId must be declared using the Input Storage Class

  • VUID-LocalInvocationId-LocalInvocationId-04283
    The variable decorated with LocalInvocationId must be declared as a three-component vector of 32-bit integer values

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 2014-2023 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0