SPIR-V Built-In

BaryCoordKHR

Barycentric coordinates of a fragment
BaryCoordKHR

The BaryCoordKHR decoration can be used to decorate a fragment shader input variable. This variable will contain a three-component floating-point vector with barycentric weights that indicate the location of the fragment relative to the screen-space locations of vertices of its primitive, obtained using perspective interpolation.

Valid Usage

VUID-BaryCoordKHR-BaryCoordKHR-04154

The BaryCoordKHR decoration must be used only within the Fragment Execution Model

VUID-BaryCoordKHR-BaryCoordKHR-04155

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

VUID-BaryCoordKHR-BaryCoordKHR-04156

The variable decorated with BaryCoordKHR must be declared as a three-component vector of 32-bit floating-point values