?/TD> |
Microsoft DirectX 9.0 |
Source swizzle allows individual component of a source register to take on the value of any of the four components of the same source register before the register is read for computation.
For example, the .zxxy swizzle means:
The components can appear in any order. If fewer than four components are specified, the last component is repeated. For example:
.xy = .xyyy .wzx = .wzxx .z = .zzzz
If no component is specified, no swizzling is applied.
Some instructions have restrictions for source swizzle. They are listed in the respected instruction reference pages.
Vertex shader versions | 1_1 | 2_0 | 2_x | 2_sw | 3_0 | 3_sw |
---|---|---|---|---|---|---|
swizzling | x | x | x | x | x | x |
Swizzles can be applied to source registers in an arbitrary order; that is, any source register can take any component mask, in any order.
Vertex shader versions | 1_1 | 2_0 | 2_x | 2_sw | 3_0 | 3_sw |
---|---|---|---|---|---|---|
arbitrary swizzling | x | x | x | x | x | x |
Replicate swizzle, is used to replicate or copy one component to another. This is, exactly one of the .x, .y, .z, .w swizzle components (or the .r, .g, .b, .a equivalents) must be specified.