---
layout: stdlib-reference
---
# EvaluateAttributeSnapped
## Description
Interpolates vertex attribute at the specified subpixel offset.
## Signature
T EvaluateAttributeSnapped<T>(
T x,
vector<int, 2> offset)
where T : __BuiltinArithmeticType;
vector<T, N> EvaluateAttributeSnapped<T, N:int>(
vector<T, N> x,
vector<int, 2> offset)
where T : __BuiltinArithmeticType;
matrix<T, N, M> EvaluateAttributeSnapped<T, N:int, M:int>(
matrix<T, N, M> x,
vector<int, 2> offset)
where T : __BuiltinArithmeticType;
## Generic Parameters
#### T: [\_\_BuiltinArithmeticType](../interfaces/0_builtinarithmetictype-029j/index.html)
#### N : int
#### M : int
## Parameters
#### x : [T](evaluateattributesnapped-08h.html#typeparam-T)
The vertex attribute to interpolate.
#### offset : [vector](../types/vector/index.html)\
The subpixel offset. Each component is a 4-bit signed integer in range [-8, 7].
#### x : [vector](../types/vector/index.html)\<[T](../types/vector/index.html#typeparam-T), [N](../types/vector/index.html#decl-N)\>
The vertex attribute to interpolate.
#### x : [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)\>
The vertex attribute to interpolate.
## Return value
The interpolated attribute value.
## Remarks
x must be a direct reference to a fragment shader varying input.
The valid values of each component of offset are:
- 1000 = -0.5f (-8 / 16)
- 1001 = -0.4375f (-7 / 16)
- 1010 = -0.375f (-6 / 16)
- 1011 = -0.3125f (-5 / 16)
- 1100 = -0.25f (-4 / 16)
- 1101 = -0.1875f (-3 / 16)
- 1110 = -0.125f (-2 / 16)
- 1111 = -0.0625f (-1 / 16)
- 0000 = 0.0f ( 0 / 16)
- 0001 = 0.0625f ( 1 / 16)
- 0010 = 0.125f ( 2 / 16)
- 0011 = 0.1875f ( 3 / 16)
- 0100 = 0.25f ( 4 / 16)
- 0101 = 0.3125f ( 5 / 16)
- 0110 = 0.375f ( 6 / 16)
- 0111 = 0.4375f ( 7 / 16)
## Availability and Requirements
Defined for the following targets:
#### hlsl
Available in stages: `amplification`, `fragment`, `compute`, `mesh`, `miss`, `callable`, `closesthit`, `raygen`, `intersection`, `anyhit`.
#### glsl
Available in stages: `amplification`, `fragment`, `compute`, `mesh`, `miss`, `callable`, `closesthit`, `raygen`, `intersection`, `anyhit`.
#### spirv
Available in stages: `amplification`, `fragment`, `compute`, `mesh`, `miss`, `callable`, `closesthit`, `raygen`, `intersection`, `anyhit`.
Requires capabilities: `SPV_KHR_compute_shader_derivatives`, `spvMeshShadingEXT`.