Microsoft DirectX 8.0 (C++)

def

Provides a method to define constants to be used with the pixel shader.

def   vDest, fVal0, fVal1, fVal2, fVal3

Registers

vDest
Destination register, holding the result of the operation.
fVal0
Source register, specifying the input argument.
fVal1
Source register, specifying the input argument.
fVal2
Source register, specifying the input argument.
fVal3
Source register, specifying the input argument.

Remarks

The following example illustrates how the def instruction might be used. Note that the def instruction must come before other shader instructions.

Ps.1.0
def c0, 0.0f, 0.0f, 0.0f, 1.0f
def c7, 1.0f, 2.0f, 3.0f, 4.0f
tex t0
mov r0, t0

These constants are defined in the instruction stream.