phase

DirectX8

Microsoft DirectX 8.1 (pixel shader version 1.4)

phase

The phase instruction marks the transition between phase 1 and phase 2. If no phase instruction is present, the entire shader if executed as if it is a phase 2 shader.

phase

Remarks

This instruction applies to version 1.4 only.

Shader instructions that occur before the phase instruction are phase 1 instructions. All other instructions are phase 2 instructions. By having two phases for instructions, the maximum number of instructions per shader is increased.

The unfortunate side-effect of the phase transition is that the alpha component of temporary registers are unset or uninitialized during the transition.

Example

This example shows how to group instructions as phase 1 or phase 2 instructions within a shader.

The phase instruction is also commonly called the phase marker because it marks the transition between phase 1 and 2 instructions. In a version 1.4 pixel shader, if the phase marker is not present, the shader is executed as if it is running in phase 2. This is important because there are differences between phase 1 and 2 instructions and register availability. The differences are noted throughout the reference section.

ps.1.4
  // Add phase 1 instructions here.

phase
  // Add phase 2 instructions here.