-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Description
- Implement
WaveReadLaneFirstclang builtin, - Link
WaveReadLaneFirstclang builtin withhlsl_intrinsics.h - Add sema checks for
WaveReadLaneFirsttoCheckHLSLBuiltinFunctionCallinSemaChecking.cpp - Add codegen for
WaveReadLaneFirsttoEmitHLSLBuiltinExprinCGBuiltin.cpp - Add codegen tests to
clang/test/CodeGenHLSL/builtins/WaveReadLaneFirst.hlsl - Add sema tests to
clang/test/SemaHLSL/BuiltIns/WaveReadLaneFirst-errors.hlsl - Create the
int_dx_WaveReadLaneFirstintrinsic inIntrinsicsDirectX.td - Create the
DXILOpMappingofint_dx_WaveReadLaneFirstto118inDXIL.td - Create the
WaveReadLaneFirst.llandWaveReadLaneFirst_errors.lltests inllvm/test/CodeGen/DirectX/ - Create the
int_spv_WaveReadLaneFirstintrinsic inIntrinsicsSPIRV.td - In SPIRVInstructionSelector.cpp create the
WaveReadLaneFirstlowering and map it toint_spv_WaveReadLaneFirstinSPIRVInstructionSelector::selectIntrinsic. - Create SPIR-V backend test case in
llvm/test/CodeGen/SPIRV/hlsl-intrinsics/WaveReadLaneFirst.ll
DirectX
| DXIL Opcode | DXIL OpName | Shader Model | Shader Stages |
|---|---|---|---|
| 118 | WaveReadLaneFirst | 6.0 | ('library', 'compute', 'amplification', 'mesh', 'pixel', 'vertex', 'hull', 'domain', 'geometry', 'raygeneration', 'intersection', 'anyhit', 'closesthit', 'miss', 'callable', 'node') |
SPIR-V
OpGroupNonUniformBroadcastFirst:
Description:
Result is the Value of the invocation from the active
invocation with the lowest id in the group to all active
invocations in the group.
Result Type must be a scalar or vector of floating-point
type, integer type, or Boolean
type.
Execution is a Scope that identifies the group of
invocations affected by this command. It must be Subgroup.
The type of Value must be the same as Result Type.
Capability:
GroupNonUniformBallot
Missing before version 1.3.
| Word Count | Opcode | Results | Operands | ||
|---|---|---|---|---|---|
5 |
338 |
<id> |
Scope <id> |
<id> |
Test Case(s)
Example 1
//dxc WaveReadLaneFirst_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export float4 fn(float4 p1) {
return WaveReadLaneFirst(p1);
}HLSL:
Returns the value of the expression for the active lane of the current wave with the smallest index.
Syntax
<type> WaveReadLaneFirst(
<type> expr
);Parameters
-
expr
-
The expression to evaluate.
Return value
The resulting value is uniform across the wave.
Remarks
This function is supported from shader model 6.0 in all shader stages.
See also
Metadata
Metadata
Assignees
Labels
Type
Projects
Status