![]() |
![]() |
![]() |
The various types of output registers have been collapsed into twelve output registers (two for color, eight for texture, one for position, and one for fog and point size). These can be used for anything the user wants to interpolate for the pixel shader: texture coordinates, colors, fog, and so on.
Output registers require declarations that include semantics. For instance, the old position and point size registers are replaced by declaring an output register with a position or point-size semantic.
Of the twelve output registers, any ten (not necessarily o0 to o9) have four components (xyzw), another one must be declared as position (and must also include all four components), and optionally one more can be a scalar point size.
The syntax for declaring output registers is similar to the declarations for the input register:
dcl_semantics o[.write_mask] |
Where:
Vertex shader versions | 3_0 | 3_sw |
---|---|---|
dcl_usage | x | x |
All dcl_usage instructions must appear before the first executable instruction.
vs_3_0 dcl_color4 o3.x // color4 is a semantic name. dcl_texcoord3 o3.yz // Different semantics can be packed into one register. dcl_fog o3.w dcl_tangent o4.xyz dcl_position o7.xyzw // position must be declared to some unique register // in a vertex shader, with all 4 components. dcl_psize o6 // Pointsize cannot have a mask // (that is, mask is full .xyzw) // This is an implied scalar register. // No other semantics can be assigned to any components // of this register. // If pointsize declaration is not used (typical), // only 11 "out" registers are available, not 12. // Pixel shaders cannot see this value.