Microsoft DirectX 8.0 (Visual Basic)

Pixel Shader Order of Operations

The order of operations for processing pixel instructions and modifiers is defined as follows: the input or argument modifier is applied, the core instruction is executed, the output or instruction modifier is applied, and then the result is written with respect to the output write mask.

For the input or argument modifiers, the ordering is as follows: bias is applied, scaling is applied, and then the negate or complement step is performed. Alpha replication is also performed at this stage. For the output or instruction modifiers, the scale/shift operations have higher precedence than the saturation step.

The net ordering of operations is defined by the following list.

  1. The Argument Modifiers are applied.
  2. The core instruction is executed.
  3. The Instruction Modifiers are applied.
  4. The Output Write Masks are applied.