Microsoft DirectX 9.0

Register Modifiers

Use source register modifiers to change the value read from a register before an instruction runs. The contents of a source register are left unchanged. Modifiers are useful for adjusting the range of register data in preparation for the instruction. A set of modifiers called selectors copies or replicates the data from a single channel (r,g,b,a) into the other channels.

Version 1_4 shaders have modifier functionality specific to shader instructions texld and texcrd. These modifiers affect version 1_4 texture registers and are detailed in Texture Register Modifiers.

Source register modifiers SyntaxVersion
1_1 1_2 1_3 1_4
bias register_bias X X X X
invert 1 - register X X X X
negate - register X X X X
scale by 2 register_x2 X
signed scaling register_bx2 X X X X

Source register modifiers can be used only on arithmetic instructions. They cannot be used on texture address instructions. The exception to this is the Scale x 2 modifier (_bx2). For version 1_1, signed scale can be used on the source argument of any texm* instruction. For version 1_2 or 1_3, signed scale can be used on the source argument of any texture address instruction.

Some modifier specific restrictions:

© 2002 Microsoft Corporation. All rights reserved.