--- layout: stdlib-reference --- # GetAttributeAtVertex ## Description Get the value of a vertex attribute at a specific vertex. The GetAttributeAtVertex() function can be used in a fragment shader to get the value of the given attribute at the vertex of the primitive that corresponds to the given vertexIndex. Note that the attribute must have been a declared varying input to the fragment shader with the nointerpolation modifier. This function can be applied to scalars, vectors, and matrices of built-in scalar types. ## Signature
T GetAttributeAtVertex<T>(
T attribute,
uint vertexIndex)
where T : __BuiltinType;
vector<T, N> GetAttributeAtVertex<T, int N>(
vector<T, N> attribute,
uint vertexIndex)
where T : __BuiltinType;
matrix<T, N, M> GetAttributeAtVertex<T, int N, int M>(
matrix<T, N, M> attribute,
uint vertexIndex)
where T : __BuiltinType;
## Generic Parameters
#### T: \_\_BuiltinType
#### N : int
#### M : int
## Parameters
#### attribute : [T](getattributeatvertex-03ce.html#typeparam-T)
#### vertexIndex : uint
#### attribute : [vector](../types/vector/index.html)\<[T](../types/vector/index.html#typeparam-T), [N](../types/vector/index.html#decl-N)\>
#### attribute : [matrix](../types/matrix/index.html)\<[T](../types/matrix/t-0.html), [N](../types/matrix/index.html#decl-N), [M](../types/matrix/index.html#decl-M)\>
## Availability and Requirements
Defined for the following targets:
#### hlsl
Available in `fragment` stage only.
#### glsl
Available in `fragment` stage only.
#### spirv
Available in `fragment` stage only.
Requires capability: `spvFragmentBarycentricKHR`.