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, int N>(
    vector<T, N> x,
    vector<int, 2> offset)
    where T : __BuiltinArithmeticType;

matrix<T, N, M> EvaluateAttributeSnapped<T, int N, int M>(
    matrix<T, N, M> x,
    vector<int, 2> offset)
    where T : __BuiltinArithmeticType;

Generic Parameters

T: __BuiltinArithmeticType

N : int

M : int

Parameters

x : T

The vertex attribute to interpolate.

offset : vector<int, 2>

The subpixel offset. Each component is a 4-bit signed integer in range [-8, 7].

x : vector<T, N>

The vertex attribute to interpolate.

x : matrix<T, N, 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.