Implement the EvaluateAttributeSnapped
HLSL Function
#99111
Labels
backend:DirectX
bot:HLSL
HLSL
HLSL Language Support
metabug
Issue to collect references to a group of similar or related issues.
EvaluateAttributeSnapped
clang builtin,EvaluateAttributeSnapped
clang builtin withhlsl_intrinsics.h
EvaluateAttributeSnapped
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
EvaluateAttributeSnapped
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
clang/test/CodeGenHLSL/builtins/EvaluateAttributeSnapped.hlsl
clang/test/SemaHLSL/BuiltIns/EvaluateAttributeSnapped-errors.hlsl
int_dx_EvaluateAttributeSnapped
intrinsic inIntrinsicsDirectX.td
DXILOpMapping
ofint_dx_EvaluateAttributeSnapped
to87
inDXIL.td
EvaluateAttributeSnapped.ll
andEvaluateAttributeSnapped_errors.ll
tests inllvm/test/CodeGen/DirectX/
DirectX
SPIR-V
There is no support for
EvaluateAttributeSnapped
when targeting SPIR-V.Test Case(s)
Example 1
HLSL:
Evaluates at the pixel centroid with an offset.
Syntax
Parameters
value [in]
Type: attrib numeric
The input value.
offset [in]
Type: int2
A 2D offset from the pixel center using a 16x16 grid.
Remarks
The range for the offset parameter must be defined by the following byte code.
Only the least significant 4 bits of the first two components (U, V) of the pixel offset are used. The conversion from the 4-bit fixed point to float is as follows (MSB...LSB), where the MSB is both a part of the fraction and determines the sign:
Note
The left and top edges of a pixel are included in the offset; however, the bottom and right edges are not included. All other bits in the 32-bit integer U and V offset values are ignored.
An implementation can take the offset provided by the shader and obtain a full 32-bit fixed point value (28.4), which spans the valid range, by performing the following calculation:
If an implementation must map the offset to a floating-point offset, it performs the following calculation:
Minimum Shader Model
This function is supported in the following shader models.
This function is supported in the following types of shaders:
See also
Intrinsic Functions
Shader Model 5
The text was updated successfully, but these errors were encountered: