Export (0) Print
Expand All

def - ps

Defines pixel shader floating-point constants.

Syntax

def dst, fVvalue1, fValue2, fValue3, fValue4

 

Where:

  • dst is the destination register.
  • fValue1 to fValue4 are floating-point values..

Remarks

Pixel shader versions1_11_21_31_42_02_x2_sw3_03_sw
defxxxxxxxxx

 

There are two ways to set a floating-point constant in a pixel shader.

  1. Use def to define the constant directly inside a shader.
  2. Use the API to set a constant with SetPixelShaderConstantF.

def defines a shader constant whose value is loaded any time a shader is set to a device. These are called immediate constants. Immediate constants take precedence over constants set by the API method.

  • Must appear before the first arithmetic or addressing instruction in shader.
  • Can be intermixed with dcl - (sm2, sm3 - ps asm) instructions (which are the other type of instruction that resides at the beginning of a shader).
  • dst register must be a constant register.
  • Write mask must be full (default).
  • If a constant register is defined multiple times in a shader, the last one persists.

 

 

Community Additions

ADD
Show:
© 2014 Microsoft