Source Register Invert

Performs a (1 - value) calculation for each channel of the specified register.

Syntax

1 - register

Registers

Source Register. For more about register types, see ps_1_1__ps_1_2__ps_1_3__ps_1_4 Registers.

Remarks

The contents of the register are not changed. The modifier is applied only to the data read from the register. The invert operation is applied to all four color channels (RGBA).

This modifier can be used only with arithmetic instructions. In addition, this modifier cannot be combined with the other Destination Register Write Mask.

Example

This example uses inversion to generate the complement of register r1.

mul r0, r0, 1-r1;

Pixel Shader Source Register Modifiers