# SampleId(3) Manual Page

## Name

SampleId - Sample ID within a fragment

Loading… please wait.

## Description

`SampleId`

  Decorating a variable with the `SampleId` built-in decoration will make that variable contain the coverage index for the current fragment shader invocation. `SampleId` ranges from zero to the number of samples in the framebuffer minus one. If a fragment shader entry point’s interface includes an input variable decorated with `SampleId`, Sample Shading is considered enabled with a `minSampleShading` value of 1.0.

Valid Usage

- VUID-SampleId-SampleId-04354
  The `SampleId` decoration must be used only within the `Fragment` `Execution` `Model`

- VUID-SampleId-SampleId-04355
  The variable decorated with `SampleId` must be declared using the `Input` `Storage` `Class`

- VUID-SampleId-SampleId-04356
  The variable decorated with `SampleId` 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-2025 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0