-
Notifications
You must be signed in to change notification settings - Fork 15.8k
Open
Labels
HLSLHLSL Language SupportHLSL Language Supportbackend:DirectXbot:HLSLmetaissueIssue to collect references to a group of similar or related issues.Issue to collect references to a group of similar or related issues.
Description
- Implement
EvaluateAttributeAtSampleclang builtin, - Link
EvaluateAttributeAtSampleclang builtin withhlsl_intrinsics.h - Add sema checks for
EvaluateAttributeAtSampletoCheckHLSLBuiltinFunctionCallinSemaChecking.cpp - Add codegen for
EvaluateAttributeAtSampletoEmitHLSLBuiltinExprinCGBuiltin.cpp - Add codegen tests to
clang/test/CodeGenHLSL/builtins/EvaluateAttributeAtSample.hlsl - Add sema tests to
clang/test/SemaHLSL/BuiltIns/EvaluateAttributeAtSample-errors.hlsl - Create the
int_dx_EvaluateAttributeAtSampleintrinsic inIntrinsicsDirectX.td - Create the
DXILOpMappingofint_dx_EvaluateAttributeAtSampleto88inDXIL.td - Create the
EvaluateAttributeAtSample.llandEvaluateAttributeAtSample_errors.lltests inllvm/test/CodeGen/DirectX/
DirectX
| DXIL Opcode | DXIL OpName | Shader Model | Shader Stages |
|---|---|---|---|
| 88 | EvalSampleIndex | 6.0 | ('pixel',) |
SPIR-V
There is no support for EvaluateAttributeAtSample when targeting SPIR-V.
Test Case(s)
Example 1
//dxc EvaluateAttributeAtSample_test.hlsl -T lib_6_8 -enable-16bit-types -O0
[numthreads(1, 1, 1)]
[shader("pixel")]
float4 fn(float4 p1 : COLOR ) : SV_Target {
uint p2;
return EvaluateAttributeAtSample(p1, p2);
}HLSL:
Evaluates at the indexed sample location.
Syntax
numeric EvaluateAttributeAtSample(
in attrib numeric value,
in uint sampleindex
);Parameters
-
value [in]
-
Type: attrib numeric
The input value.
-
sampleindex [in]
-
Type: uint
The sample location.
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
Labels
HLSLHLSL Language SupportHLSL Language Supportbackend:DirectXbot:HLSLmetaissueIssue to collect references to a group of similar or related issues.Issue to collect references to a group of similar or related issues.
Type
Projects
Status
No status