SPIR-V Built-In

DeviceIndex

Index of the device executing the shader
DeviceIndex

The DeviceIndex decoration can be applied to a shader input which will be filled with the device index of the physical device that is executing the current shader invocation. This value will be in the range \[0,max(1,physicalDeviceCount))\[0,max(1,physicalDeviceCount)), where physicalDeviceCount is the physicalDeviceCount member of VkDeviceGroupDeviceCreateInfo.

Valid Usage

VUID-DeviceIndex-DeviceIndex-04205

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

VUID-DeviceIndex-DeviceIndex-04206

The variable decorated with DeviceIndex must be declared as a scalar 32-bit integer value