?/TD> |
Microsoft DirectX 9.0 |
A write mask controls which components of a destination register are written after an instruction is completed. An output write mask is allowed as long as the components are in the order of .rgba or .xyzw. That is, .rba and .xw are valid masks. Texture registers have one set of rules and non-texture registers have another set of rules.
As shown in the following table, masking can be applied to the individual components of a destination register.
Component modifier | Description |
---|---|
r.{x}{y}{z}{w} | Destination mask |
In general, specifying destination register write masks is good coding style. It makes code easier to read and maintain. Any combination of components may be specified (including none) as long as x precedes y, y precedes z, and z precedes w.
The following output registers have restrictions for write mask:
Register Type | Required Write Mask |
---|---|
oFog | no explicit write mask allowed on a scalar register |
oPts | no explicit write mask allowed on a scalar register |
oPos | combined mask: .xyzw(which is the default) |
oT# | combined mask: .x | .xy | .xyz | .xyzw (which is the default) |
The following versions support masking.
Pixel shader versions | 1_1 | 1_2 | 1_3 | 1_4 | 2_0 | 2_x | 2_sw | 3_0 | 3_sw |
---|---|---|---|---|---|---|---|---|---|
destination register masking | x | x | x | x | x | x | x | x | x |