Description
- Implement
GetRenderTargetSamplePosition
clang builtin,LinkGetRenderTargetSamplePosition
clang builtin withhlsl_intrinsics.h
Add sema checks forGetRenderTargetSamplePosition
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
Add codegen forGetRenderTargetSamplePosition
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
Add codegen tests toclang/test/CodeGenHLSL/builtins/GetRenderTargetSamplePosition.hlsl
Add sema tests toclang/test/SemaHLSL/BuiltIns/GetRenderTargetSamplePosition-errors.hlsl
Create theint_dx_GetRenderTargetSamplePosition
intrinsic inIntrinsicsDirectX.td
Create theDXILOpMapping
ofint_dx_GetRenderTargetSamplePosition
to76
inDXIL.td
Create theGetRenderTargetSamplePosition.ll
andGetRenderTargetSamplePosition_errors.ll
tests inllvm/test/CodeGen/DirectX/
DirectX
DXIL Opcode | DXIL OpName | Shader Model | Shader Stages |
---|---|---|---|
76 | RenderTargetGetSamplePosition | 6.0 | ('pixel',) |
SPIR-V
There is no support for GetRenderTargetSamplePosition
when targeting SPIR-V.
Test Case(s)
Example 1
//dxc GetRenderTargetSamplePosition_test.hlsl -T lib_6_8 -enable-16bit-types -O0
[numthreads(1, 1, 1)]
[shader("pixel")]
float2 fn( ) : SV_Target {
int p1;
return GetRenderTargetSamplePosition(p1);
}
HLSL:
Gets the sampling position (x,y) for a given sample index.
float<2> GetRenderTargetSamplePosition( in int<1> Index
);
Parameters
Item | Description |
---|---|
Index |
[in] A zero-based sample index. |
Return Value
The (x,y) position of the given sample.
Remarks
Use this function and GetRenderTargetSampleCount to find out the number and position of the sampling locations for a render target.
Minimum Shader Model
This function is supported in the following shader models.
Shader Model | Supported |
---|---|
Shader Model 4 and higher shader models | yes |
Shader Model 3 (DirectX HLSL) | no |
Shader Model 2 (DirectX HLSL) | no |
Shader Model 1 (DirectX HLSL) | no |
See also
Metadata
Metadata
Assignees
Type
Projects
Status
Ready
Milestone
Relationships
Development
No branches or pull requests
Activity
davidcook-msft commentedon Nov 12, 2024
@farzonl to create a new issue to track making this Op in SPIR-V