-
Notifications
You must be signed in to change notification settings - Fork 16.7k
Description
- Implement
QuadReadAcrossYclang builtin, - Link
QuadReadAcrossYclang builtin withhlsl_intrinsics.h - Add sema checks for
QuadReadAcrossYtoCheckHLSLBuiltinFunctionCallinSemaChecking.cpp - Add codegen for
QuadReadAcrossYtoEmitHLSLBuiltinExprinCGBuiltin.cpp - Add codegen tests to
clang/test/CodeGenHLSL/builtins/QuadReadAcrossY.hlsl - Add sema tests to
clang/test/SemaHLSL/BuiltIns/QuadReadAcrossY-errors.hlsl - Create the
int_dx_QuadReadAcrossYintrinsic inIntrinsicsDirectX.td - Create the
DXILOpMappingofint_dx_QuadReadAcrossYto123inDXIL.td - Create the
QuadReadAcrossY.llandQuadReadAcrossY_errors.lltests inllvm/test/CodeGen/DirectX/ - Create the
int_spv_QuadReadAcrossYintrinsic inIntrinsicsSPIRV.td - In SPIRVInstructionSelector.cpp create the
QuadReadAcrossYlowering and map it toint_spv_QuadReadAcrossYinSPIRVInstructionSelector::selectIntrinsic. - Create SPIR-V backend test case in
llvm/test/CodeGen/SPIRV/hlsl-intrinsics/QuadReadAcrossY.ll
DirectX
| DXIL Opcode | DXIL OpName | Shader Model | Shader Stages |
|---|---|---|---|
| 123 | QuadOp | 6.0 | ('library', 'compute', 'amplification', 'mesh', 'pixel', 'node') |
SPIR-V
OpGroupNonUniformQuadSwap:
Description:
Swap the Value of the invocation within the
quad with another invocation in the quad using Direction.
Result Type must be a scalar or vector of floating-point
type, integer type, or Boolean
type.
Execution is a Scope, but has no effect on the
behavior of this instruction. It must be Subgroup.
The type of Value must be the same as Result Type.
Direction is the kind of swap to perform.
Direction must be a scalar of integer type, whose
Signedness operand is 0.
Direction must come from a constant
instruction.
The value returned in Result is the value provided to Value by
another invocation in the same quad scope instance. The invocation
providing this value is determined according to Direction.
A Direction of 0 indicates a horizontal swap;
- Invocations with quad indices of 0 and 1 swap values
- Invocations with quad indices of 2 and 3 swap values
A Direction of 1 indicates a vertical swap; - Invocations with quad indices of 0 and 2 swap values
- Invocations with quad indices of 1 and 3 swap values
A Direction of 2 indicates a diagonal swap; - Invocations with quad indices of 0 and 3 swap values
- Invocations with quad indices of 1 and 2 swap values
Direction must be one of the above values.
If an active invocation reads Value from an inactive invocation, the
resulting value is undefined.
Capability:
GroupNonUniformQuad
Missing before version 1.3.
| Word Count | Opcode | Results | Operands | |||
|---|---|---|---|---|---|---|
6 |
366 |
<id> |
Scope <id> |
<id> |
<id> |
Test Case(s)
Example 1
//dxc QuadReadAcrossY_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export float4 fn(float4 p1) {
return QuadReadAcrossY(p1);
}Example 2
//dxc QuadReadAcrossY_1_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export uint4 fn(uint4 p1) {
return QuadReadAcrossY(p1);
}Example 3
//dxc QuadReadAcrossY_2_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export int4 fn(int4 p1) {
return QuadReadAcrossY(p1);
}HLSL:
Returns the specified source value read from the other lane in this quad in the Y direction.
Syntax
<type> QuadReadAcrossY(
<type> localValue
);Parameters
-
localValue
-
The requested type.
Return value
The specified source value. If the source lane is inactive, the results are undefined.
Remarks
For more information on quads, refer to Overview of Shader Model 6.
This function is supported from shader model 6.0 only in pixel and compute shaders.
See also
Metadata
Metadata
Assignees
Labels
Type
Projects
Status