dp2add (Pixel Shader)
Performs a 2-D dot product and a scalar addition.
Syntax
dp2add[_sat] dst[.mask], [-]src0[.swizzle],
[-]src1[.swizzle],
[-]src2[.replicate_swizzle]
Where:
- [_sat] - is an optional saturate modifier.
- dest - is a destination register. The see more about the limitations of pixel shader registers with this instruction, see the remarks below.
- [_mask] - is an optional mask modifier.
- [-] - is an optional negate modifier.
- src0, src1, src2 - three input source registers. Each of these registers allows an optional negate [-] modifier. src0 and src1 allow an optional swizzle mask [.swizzle]. src2 requires replicate swizzle mask. [.replicate_swizzle].
- [swizzle, replicateSwizzle-] - are optional swizzle modifiers.
Remarks
Pixel shader versions | 1_1 | 1_2 | 1_3 | 1_4 | 2_0 | 2_x | 2_sw | 3_0 | 3_sw |
---|
dp2add | | | | | x | x | x | x | x |
---|
The scalar value for add is chosen by the replicate swizzle on src2.
The following code fragment shows the operations performed.
dest = src0.r * src1.r + src0.g * src1.g + src2.selected_component
// The scalar result is replicated to write mask components
Instruction Information
Minimum operating system | Windows 98 |
---|