Wave: A set of lanes executed simultaneously in the processor.
Helper Lane: A lane which is executed solely for the purpose of gradients in pixel shader quads.
Inactive Lane / Active Lane: a lane which is not being executed at this point in the code. (条件分支引起的控制流不同,不同的控制流,线程会呈现Active Or Inactive状态,如下图)
Quad: A set of 4 adjacent lanes corresponding to pixels arranged in a 2x2 square. (Quad模式,4个lane形成一个Quad)
Wave Query
Name
Description
Shader Model
WaveGetLaneCount
Returns the number of lanes in the current wave.
SM6.0
WaveGetLaneIndex
Returns the index of the current lane within the current wave.
SM6.0
WaveIsFirstLane
Returns true only for the active lane in the current wave with the smallest index
SM6.0
IsHelperLane
Returns true if a given lane in a pixel shader is a helper lane.
SM6.6
Wave Vote
Name
Description
Shader Model
WaveActiveAnyTrue
Returns true if the expression is true in any active lane in the current wave.
SM6.0
WaveActiveAllTrue
Returns true if the expression is true in all active lanes in the current wave.
SM6.0
WaveActiveBallot
Returns a 64-bit unsigned integer bitmask of the evaluation of the Boolean expression for all active lanes in the specified wave.
SM6.0
Wave Broadcast
Name
Description
Shader Model
WaveReadLaneAt
Returns the value of the expression for the given lane index within the specified wave.
SM6.0
WaveReadLaneFirst
Returns the value of the expression for the active lane of the current wave with the smallest index.
SM6.0
Wave Reduction
Name
Description
Shader Model
WaveActiveAllEqual
Returns true if the expression is the same for every active lane in the current wave (and thus uniform across it).
SM6.0
WaveActiveBitAnd
Returns the bitwise AND of all the values of the expression across all active lanes in the current wave, and replicates the result to all lanes in the wave.
SM6.0
WaveActiveBitOr
Returns the bitwise OR of all the values of the expression across all active lanes in the current wave, and replicates the result to all lanes in the wave.
SM6.0
WaveActiveBitXor
Returns the bitwise Exclusive OR of all the values of the expression across all active lanes in the current wave, and replicates the result to all lanes in the wave.
SM6.0
WaveActiveCountBits
Counts the number of boolean variables which evaluate to true across all active lanes in the current wave, and replicates the result to all lanes in the wave.
SM6.0
WaveActiveMax
Computes the maximum value of the expression across all active lanes in the current wave, and replicates the result to all lanes in the wave.
SM6.0
WaveActiveMin
Computes the minimum value of the expression across all active lanes in the current wave, and replicates the result to all lanes in the wave.
SM6.0
WaveActiveProduct
Multiplies the values of the expression together across all active lanes in the current wave, and replicates the result to all lanes in the wave.
SM6.0
WaveActiveSum
Sums up the value of the expression across all active lanes in the current wave and replicates it to all lanes in the current wave, and replicates the result to all lanes in the wave.
SM6.0
Wave Scan and Prefix
Name
Description
Shader Model
WavePrefixCountBits
Returns the sum of all the specified boolean variables set to true across all active lanes with indices smaller than the current lane.
SM6.0
WavePrefixSum
Returnsthe sum of all of the values in the active lanes with smaller indices than this one.
SM6.0
WavePrefixProduct
Returns the product of all of the values in the lanes before this one of the specified wave.
SM6.0
Quad-wide Shuffle operations (Only PS)
Name
Description
Shader Model
QuadReadLaneAt
Returns the specified source value read from the lane of the current quad identified by quadLaneID [0…3] which must be uniform across the quad.
SM6.0
QuadReadAcrossDiagonal
Returns the specified local value which is read from the diagonally opposite lane in this quad.
SM6.0
QuadReadAcrossX
Returns the specified source value read from the other lane in this quad in the X direction.
SM6.0
QuadReadAcrossY
Returns the specified source value read from the other lane in this quad in the Y direction.