Open
Description
- Implement
EvaluateAttributeCentroid
clang builtin, - Link
EvaluateAttributeCentroid
clang builtin withhlsl_intrinsics.h
- Add sema checks for
EvaluateAttributeCentroid
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
- Add codegen for
EvaluateAttributeCentroid
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
- Add codegen tests to
clang/test/CodeGenHLSL/builtins/EvaluateAttributeCentroid.hlsl
- Add sema tests to
clang/test/SemaHLSL/BuiltIns/EvaluateAttributeCentroid-errors.hlsl
- Create the
int_dx_EvaluateAttributeCentroid
intrinsic inIntrinsicsDirectX.td
- Create the
DXILOpMapping
ofint_dx_EvaluateAttributeCentroid
to89
inDXIL.td
- Create the
EvaluateAttributeCentroid.ll
andEvaluateAttributeCentroid_errors.ll
tests inllvm/test/CodeGen/DirectX/
DirectX
DXIL Opcode | DXIL OpName | Shader Model | Shader Stages |
---|---|---|---|
89 | EvalCentroid | 6.0 | ('pixel',) |
SPIR-V
There is no support for EvaluateAttributeCentroid
when targeting SPIR-V.
Test Case(s)
Example 1
//dxc EvaluateAttributeCentroid_test.hlsl -T lib_6_8 -enable-16bit-types -O0
[numthreads(1, 1, 1)]
[shader("pixel")]
float4 fn(float4 p1 : COLOR ) : SV_Target {
return EvaluateAttributeCentroid(p1);
}
HLSL:
Evaluates at the pixel centroid.
Syntax
numeric EvaluateAttributeCentroid(
in attrib numeric value
);
Parameters
-
value [in]
-
Type: attrib numeric
The input value.
Remarks
Interpolation mode can be linear or linear_no_perspective on the variable. Use of centroid or sample is ignored. Attributes with constant interpolation are also allowed, in which case the sample index is ignored.
Minimum Shader Model
This function is supported in the following shader models.
Shader Model | Supported |
---|---|
Shader Model 5 and higher shader models | yes |
This function is supported in the following types of shaders:
Vertex | Hull | Domain | Geometry | Pixel | Compute |
---|---|---|---|---|---|
x |
See also
Metadata
Metadata
Assignees
Type
Projects
Status
No status