Real-Time Shader Programming

| | In DirectX 8 pixel shaders, only the r0 register was used to hold the output color. In DirectX 9 there is better support for specifying a texture as a render target: the Multiple Render Target (MRT) or a subset called the Multi-Element Texture (MET). This allows one to specify up to a four-dimensional texture (with an optional depth value) as output from a pixel shader. |
If you're not using a MRT/MET, the syntax is to use the oC0 register as the output color register. If your device supports multiple render targets, the output colors are sent to the appropriate render target. To use MRT/MET you'd use the four output color registers and output depth register. These registers are oC0 though oC3. The output registers must be written to in ascending order, and all elements of each register must be written to. Each register can only be written to once in a shader. If there's a depth buffer attached to the MRT surface, you can specify a depth value for the pixel in the oDepth register. This is a scalar register.
The restrictions on using an MRT as a destination are
The color elements can only be written with an .rgba mask.
You can write to an oCn or oDepth register only once per shader.
You must write to the oC0 register.
No_sat or source modifiers.
You cannot use an output...