def (Pixel Shader)
Defines pixel shader floating-point constants.
Syntax
def dest, fVvalue1, fValue2, fValue3, fValue4 |
---|
Where:
- dst is the destination register.
- fValue1 to fValue4 are floating-point values..
Remarks
Pixel shader versions | 1_1 | 1_2 | 1_3 | 1_4 | 2_0 | 2_x | 2_sw | 3_0 | 3_sw |
---|
def | x | x | x | x | x | x | x | x | x |
---|
There are two ways to set a floating-point constant in a pixel shader.
- Use def to define the constant directly inside a shader.
- Use the API to set a constant with IDirect3DDevice9::SetPixelShaderConstantF.
The def instruction 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 application programming interface (API) method.
- Must appear before the first arithmetic or addressing instruction in shader.
- Can be intermixed with dcl instructions (which are the other type of instruction that resides at the beginning of a shader).
- dst register must be a constant register (cn).
- Write mask must be full (default).
- If a constant register is defined multiple times in a shader, the last one persists.
Instruction Information
Minimum operating system | Windows 98 |
---|