# InstanceId(3) Manual Page

## Name

InstanceId - Id associated with an intersected instance

Loading… please wait.

## Description

`InstanceId`

  Decorating a variable in an intersection, any-hit, or closest hit shader with the `InstanceId` decoration will make that variable contain the index of the instance that intersects the current ray.

Valid Usage

- VUID-InstanceId-InstanceId-04254
  The `InstanceId` decoration must be used only within the `IntersectionKHR`, `AnyHitKHR`, or `ClosestHitKHR` `Execution` `Model`

- VUID-InstanceId-InstanceId-04255
  The variable decorated with `InstanceId` must be declared using the `Input` `Storage` `Class`

- VUID-InstanceId-InstanceId-04256
  The variable decorated with `InstanceId` 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-2024 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0