|Microsoft DirectX 9.0|
Pixel shader output registers represent the different elements of a Multielement Texture.
Output Color Register
Name Description oC0 Color 0 (element 0) oC1 Color 1 (element 1) oC2 Color 2 (element 2) oC3 Color 3 (element 3) oDepth New depth value for depth test against depth-stencil buffer.
If an application has a w-buffer set as its depth buffer, the application might also need to send w-range information to the pixel shader to scale the w-values written out to oDepth.
Additional output register properties:
- These must be written to using a mov instruction.
- There can be only one write to an any oCn register per shader.
- Write masks cannot be used. All four channels of oCn registers are emitted from the pixel shader. The mov instruction writing to an oCn register must have a source parameter (r#/v#/t#/c#) containing no swizzle or modifier. oDepth register is a scalar output, and the mov instruction that writes to it must use a source parameter (r#/v#/t#/c#) using a REPLICATE swizzle on the source and no modifier. This is the generalization of the texm3x2depth instruction in ps_1_3 and texdepth in ps_1_4.
- The runtime will fail validation if there are uninitialized registers that get written to.
- The minimal shader always has to write all four components of oC0. If any of the others are used, all four channels should be written.
- If oCn is written to using a mov instruction but there is no corresponding element in the multielement texture surface set as a render target, this instruction is ignored.
- If no depth buffer had been created/attached to the device, mov to the oDepth register is ignored.
- Each mov into output registers consume one instruction slot and can be present anywhere in the shader, in any order. oCn registers have to be updated in a contiguous way. That is, if you write to oCn, you must also write from oC0 to oCn-1.
Minimum operating system Windows 98
Minimum operating systems Windows 98