Description
- Implement
WaveReadLaneAt
clang builtin,LinkWaveReadLaneAt
clang builtin withhlsl_intrinsics.h
Add sema checks forWaveReadLaneAt
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
Add codegen forWaveReadLaneAt
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
Add codegen tests toclang/test/CodeGenHLSL/builtins/WaveReadLaneAt.hlsl
Add sema tests toclang/test/SemaHLSL/BuiltIns/WaveReadLaneAt-errors.hlsl
Create theint_dx_WaveReadLaneAt
intrinsic inIntrinsicsDirectX.td
Create theDXILOpMapping
ofint_dx_WaveReadLaneAt
to117
inDXIL.td
Create theWaveReadLaneAt.ll
andWaveReadLaneAt_errors.ll
tests inllvm/test/CodeGen/DirectX/
Create theint_spv_WaveReadLaneAt
intrinsic inIntrinsicsSPIRV.td
In SPIRVInstructionSelector.cpp create theWaveReadLaneAt
lowering and map it toint_spv_WaveReadLaneAt
inSPIRVInstructionSelector::selectIntrinsic
.Create SPIR-V backend test case inllvm/test/CodeGen/SPIRV/hlsl-intrinsics/WaveReadLaneAt.ll
DirectX
DXIL Opcode | DXIL OpName | Shader Model | Shader Stages |
---|---|---|---|
117 | WaveReadLaneAt | 6.0 | ('library', 'compute', 'amplification', 'mesh', 'pixel', 'vertex', 'hull', 'domain', 'geometry', 'raygeneration', 'intersection', 'anyhit', 'closesthit', 'miss', 'callable', 'node') |
SPIR-V
OpGroupNonUniformShuffle:
Description:
Result is the Value of the invocation identified by the
id Id.
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.
The type of Value must be the same as Result Type.
Id must be a scalar of integer type, whose Signedness
operand is 0.
The resulting value is undefined if Id is an inactive invocation, or
is greater than or equal to the size of the group.
Capability:
GroupNonUniformShuffle
Missing before version 1.3.
Word Count | Opcode | Results | Operands | |||
---|---|---|---|---|---|---|
6 |
345 |
<id> |
Scope <id> |
<id> |
<id> |
Test Case(s)
Example 1
//dxc WaveReadLaneAt_test.hlsl -T lib_6_8 -E fn -enable-16bit-types -spirv -fspv-target-env=universal1.5 -fcgl -O0
export float4 fn(float4 p1, uint p2) {
return WaveReadLaneAt(p1, p2);
}
HLSL:
Returns the value of the expression for the given lane index within the specified wave.
Syntax
<type> WaveReadLaneAt(
<type> expr,
uint laneIndex
);
Parameters
-
expr
-
The expression to evaluate.
-
laneIndex
-
The index of the lane for which the expr result will be returned.
Return value
The resulting value is the result of expr. It will be uniform if laneIndex is uniform.
Remarks
If laneIndex is uniform, then this is effectively a broadcast operation; otherwise, it's a shuffle operation.
The result is undefined on a helper lane, or if the lane referred to by laneIndex is inactive or a helper lane.
This function is supported from shader model 6.0 in all shader stages.
See also
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Activity
[-][HLSL] Implement `WaveReadLaneAt` intrinsic[/-][+]Implement the `WaveReadLaneAt` HLSL Function[/+]inbelic commentedon Sep 25, 2024
Taking a look into this.
WaveReadLaneAt
intrinsics #110739WaveReadLaneAt
intrinsic #111010damyanp commentedon Oct 4, 2024
Marking re-estimate this. Since this was originally refined, we have a different approach to implementing intrinsics and the way we've been estimating intrinsics has changed quite a bit.
14 remaining items