Reality Display Processor/Commands: Difference between revisions

Set Combine Mode
(Texture Rectangle)
(Set Combine Mode)
Line 1,152:
* This is an attribute-setting command that requires pipeline synchronization before use, otherwise currently rendering primitives may be partially rendered using both the old environment color and the new environment color, if it was used.
 
====<span style="display:none;">0x3c - Set_Combine_ModeSet Combine Mode ====
----
{| class="wikitable" style="text-align: center; white-space:nowrap;"
! colspan="17"|Set_Combine_ModeSet Combine Mode <code>0x3c</code>
|-
| 63:48 || — || — || colspan=6| command = 0x3c[5:0] || colspan=4| combine.sba.color[0]RGB_A_0[3:0] || colspan=4| combine.mul.color[0]RGB_C_0[4:1]
|-
| 47:32 || combine.mul.colorRGB_C_0[0] || colspan=3| combine.sba.alpha[0]Alpha_A_0[2:0] || colspan=3| combine.mul.alpha[0]Alpha_C_0[2:0] || colspan=4| combine.sba.color[1]RGB_A_1[3:0] || colspan=5| combine.mul.color[1]RGB_C_1[4:0]
|-
| 31:16 || colspan=4| combine.sbb.color[0]RGB_B_0[3:0] || colspan=4| combine.sbb.color[1]RGB_B_1[3:0] || colspan=3| combine.sba.alpha[1]Alpha_A_1[2:0] || colspan=3| combine.mul.alpha[1]Alpha_C_1[2:0] || colspan=2| combine.add.color[0]RGB_D_0[2:1]
|-
| 15:0 || combine.add.colorRGB_D_0[0] || colspan=3| combine.sbb.alpha[0]Alpha_B_0[2:0] || colspan=3| combine.add.alpha[0]Alpha_D_0[2:0] || colspan=3| combine.add.color[1]RGB_D_1[2:0] || colspan=3| combine.sbb.alpha[1]Alpha_B_1[2:0] || colspan=3| combine.add.alpha[1]Alpha_D_1[2:0]
|}
{{#invoke:Register table|definitions
| 61:56 | command[5:0] | 0x3c
| 55:52 | combine.sba.color[0]RGB_A_0[3:0] | -RGB A Input (First Cycle)
| 51:47 | combine.mul.color[0]RGB_C_0[4:0] | -RGB C Input (First Cycle)
| 46:44 | combine.sba.alpha[0]Alpha_A_0[2:0] | -Alpha A Input (First Cycle)
| 43:41 | combine.mul.alpha[0]Alpha_C_0[2:0] | -Alpha C Input (First Cycle)
| 40:37 | combine.sba.color[1]RGB_A_1[3:0] | -RGB A Input (Second Cycle)
| 36:32 | combine.mul.color[1]RGB_C_1[4:0] | -RGB C Input (Second Cycle)
| 31:28 | combine.sbb.color[0]RGB_B_0[3:0] | -RGB B Input (First Cycle)
| 27:24 | combine.sbb.color[1]RGB_B_1[3:0] | -RGB B Input (Second Cycle)
| 23:21 | combine.sba.alpha[1]Alpha_A_1[2:0] | -Alpha A Input (Second Cycle)
| 20:18 | combine.mul.alpha[1]Alpha_C_1[2:0] | -Alpha C Input (Second Cycle)
| 17:15 | combine.add.color[0]RGB_D_0[2:0] | -RGB D Input (First Cycle)
| 14:12 | combine.sbb.alpha[0]Alpha_B_0[2:0] | -Alpha B Input (First Cycle)
| 11:9 | combine.add.alpha[0]Alpha_D_0[2:0] | -Alpha D Input (First Cycle)
| 8:6 | combine.add.color[1]RGB_D_1[2:0] | -RGB D Input (Second Cycle)
| 5:3 | combine.sbb.alpha[1]Alpha_B_1[2:0] | -Alpha B Input (Second Cycle)
| 2:0 | combine.add.alpha[1]Alpha_D_1[2:0] | -Alpha D Input (Second Cycle)
}}
 
Configures the inputs to the Color Combiner pipeline stage. The Color Combiner stage computes the following equation
 
<math>(A - B) \cdot C + D</math>
 
This equation can be configured differently for
* Cycle 1 RGB
* Cycle 1 Alpha
* Cycle 2 RGB
* Cycle 2 Alpha
 
In 1-Cycle mode only the Cycle 2 configuration is computed, while in 2-Cycle mode both are computed and the output from Cycle 1 can be used as an input to Cycle 2. Besides some inputs behaving differently the second cycle of 2-Cycle mode and the only cycle of 1-Cycle mode behave identically, the first cycle of 2-Cycle mode is greatly simplified with no clamping occurring between combiner cycles.
 
'''Inputs for A (RGB)'''
 
{| class="wikitable"
! Value !! Name !! Description
|-
| 0 || COMBINED || Combined color from first cycle
|-
| 1 || TEX0 || Texture color sampled from the tile set in the primitive command, after texture LOD if enabled
|-
| 2 || TEX1 || Texture color sampled from the tile set in the primitive command, after texture LOD if enabled, plus one
|-
| 3 || PRIMITIVE || Primitive color register (rgb)
|-
| 4 || SHADE || Shade color interpolated per-pixel from shade coefficients
|-
| 5 || ENVIRONMENT || Environment color register (rgb)
|-
| 6 || 1 || Fixed 1
|-
| 7 || NOISE || Per-pixel noise
|-
| 8+ || 0 || Fixed 0
|}
 
'''Inputs for A (Alpha)'''
 
{| class="wikitable"
! Value !! Name !! Description
|-
| 0 || COMBINED || Combined alpha from first cycle
|-
| 1 || TEX0 || Texture alpha sampled from the tile set in the primitive command, after texture LOD if enabled
|-
| 2 || TEX1 || Texture alpha sampled from the tile set in the primitive command, after texture LOD if enabled, plus one
|-
| 3 || PRIMITIVE || Primitive color register (alpha)
|-
| 4 || SHADE || Shade alpha interpolated per-pixel from shade coefficients
|-
| 5 || ENVIRONMENT || Environment color register (alpha)
|-
| 6 || 1 || Fixed 1
|-
| 7 || 0 || Fixed 0
|}
 
'''Inputs for B (RGB)'''
 
{| class="wikitable"
! Value !! Name !! Description
|-
| 0 || COMBINED || Combined color from first cycle
|-
| 1 || TEX0 || Texture color sampled from the tile set in the primitive command, after texture LOD if enabled
|-
| 2 || TEX1 || Texture color sampled from the tile set in the primitive command, after texture LOD if enabled, plus one
|-
| 3 || PRIMITIVE || Primitive color register (rgb)
|-
| 4 || SHADE || Shade color interpolated per-pixel from shade coefficients
|-
| 5 || ENVIRONMENT || Environment color register (rgb)
|-
| 6 || CENTER || Chroma key center (see '''Set Key R''' and '''Set Key GB''')
|-
| 7 || K4 || K4 value (see '''Set Convert''')
|-
| 8+ || 0 || Fixed 0
|}
 
'''Inputs for B (Alpha)'''
 
{| class="wikitable"
! Value !! Name !! Description
|-
| 0 || COMBINED || Combined alpha from first cycle
|-
| 1 || TEX0 || Texture alpha sampled from the tile set in the primitive command, after texture LOD if enabled
|-
| 2 || TEX1 || Texture alpha sampled from the tile set in the primitive command, after texture LOD if enabled, plus one
|-
| 3 || PRIMITIVE || Primitive color register (alpha)
|-
| 4 || SHADE || Shade alpha interpolated per-pixel from shade coefficients
|-
| 5 || ENVIRONMENT || Environment color register (alpha)
|-
| 6 || 1 || Fixed 1
|-
| 7 || 0 || Fixed 0
|}
 
'''Inputs for C (RGB)'''
 
{| class="wikitable"
! Value !! Name !! Description
|-
| 0 || COMBINED || Combined color from first cycle
|-
| 1 || TEX0 || Texture color sampled from the tile set in the primitive command, after texture LOD if enabled
|-
| 2 || TEX1 || Texture color sampled from the tile set in the primitive command, after texture LOD if enabled, plus one
|-
| 3 || PRIMITIVE || Primitive color register (rgb)
|-
| 4 || SHADE || Shade color interpolated per-pixel from shade coefficients
|-
| 5 || ENVIRONMENT || Environment color register (rgb)
|-
| 6 || CENTER || Chroma key center (see '''Set Key R''' and '''Set Key GB''')
|-
| 7 || COMBINED_ALPHA || Combined alpha from first cycle
|-
| 8 || TEX0_ALPHA || Texture alpha sampled from the tile set in the primitive command, after texture LOD if enabled
|-
| 9 || TEX1_ALPHA || Texture alpha sampled from the tile set in the primitive command, after texture LOD if enabled, plus one
|-
| 10 || PRIMITIVE_ALPHA || Primitive color register (alpha)
|-
| 11 || SHADE_ALPHA || Shade alpha interpolated per-pixel from shade coefficients
|-
| 12 || ENVIRONMENT_ALPHA || Environment color register (alpha)
|-
| 13 || LOD_FRACTION || LOD Fraction computed as part of Texture LOD
|-
| 14 || PRIM_LOD_FRAC || Primitive LOD Fraction (see '''Set Primitive Color''')
|-
| 15 || K5 || K5 value (see '''Set Convert''')
|-
| 16+ || 0 || Fixed 0
|}
 
'''Inputs for C (Alpha)'''
 
{| class="wikitable"
! Value !! Name !! Description
|-
| 0 || LOD_FRACTION || LOD Fraction computed as part of Texture LOD
|-
| 1 || TEX0 || Texture alpha sampled from the tile set in the primitive command, after texture LOD if enabled
|-
| 2 || TEX1 || Texture alpha sampled from the tile set in the primitive command, after texture LOD if enabled, plus one
|-
| 3 || PRIMITIVE || Primitive color register (alpha)
|-
| 4 || SHADE || Shade alpha interpolated per-pixel from shade coefficients
|-
| 5 || ENVIRONMENT || Environment color register (alpha)
|-
| 6 || PRIM_LOD_FRAC || Primitive LOD Fraction (see '''Set Primitive Color''')
|-
| 7 || 0 || Fixed 0
|}
 
'''Inputs for D (RGB)'''
 
{| class="wikitable"
! Value !! Name !! Description
|-
| 0 || COMBINED || Combined color from first cycle
|-
| 1 || TEX0 || Texture color sampled from the tile set in the primitive command, after texture LOD if enabled
|-
| 2 || TEX1 || Texture color sampled from the tile set in the primitive command, after texture LOD if enabled, plus one
|-
| 3 || PRIMITIVE || Primitive color register (rgb)
|-
| 4 || SHADE || Shade color interpolated per-pixel from shade coefficients
|-
| 5 || ENVIRONMENT || Environment color register (rgb)
|-
| 6 || 1 || Fixed 1
|-
| 7 || 0 || Fixed 0
|}
 
'''Inputs for D (Alpha)'''
 
{| class="wikitable"
! Value !! Name !! Description
|-
| 0 || COMBINED || Combined alpha from first cycle
|-
| 1 || TEX0 || Texture alpha sampled from the tile set in the primitive command, after texture LOD if enabled
|-
| 2 || TEX1 || Texture alpha sampled from the tile set in the primitive command, after texture LOD if enabled, plus one
|-
| 3 || PRIMITIVE || Primitive color register (alpha)
|-
| 4 || SHADE || Shade alpha interpolated per-pixel from shade coefficients
|-
| 5 || ENVIRONMENT || Environment color register (alpha)
|-
| 6 || 1 || Fixed 1
|-
| 7 || 0 || Fixed 0
|}
 
'''Hazards'''
* This is a pipeline configuration command that requires pipeline synchronization before use, otherwise currently rendering primitives may be partially rendered using both the old combiner configuration and the new combiner configuration.
* In 1-Cycle mode only the second cycle configuration is used, the first cycle configuration is ignored.
* COMBINED in the first cycle (or in 1-Cycle mode) is ill-defined. It will (generally) read the previous pixel combiner output.
* If using the SHADE input the primitive must have provided shade coefficients. The SHADE input is therefore always invalid for rectangle commands as there is no option for providing shade coefficients for those.
* If using the TEX0/1 inputs the primitive must have provided texture coordinates and a tile number. Fill Rectangles cannot provide either of these so these options are always invalid for those.
* If using the LOD_FRACTION input, Texture LOD must have been enabled in othermodes.
* In 1-Cycle mode, LOD_FRACTION is not valid. (TOVERIFY in what way is it not valid? Does the 1-Cycle pipeline bypass LOD altogether, so does not update this input?)
* In 1-Cycle mode, TEX1 reads next pixel TEX0 (with some ambiguity at scanline edges)
* In 2-Cycle mode there is a pipeline bug involving TEX0 and TEX1. In the second cycle of 2-Cycle mode, TEX0 refers to TEX1 and TEX1 refers to next pixel TEX0 (with some ambiguity at scanline edges)
* The color combiner is quick to overflow. Values between 256 and 383 saturate to 255 while 384 to 511 overflow to 0. Values greater than or equal to 512 overflow the 9-bit color completely.
* Sign-extension properties differ between the A,B,D and C inputs. C is more prone to overflow, it is advisable to keep the COMBINED input out of the C input as much as possible.
* The 1 input is valued at 256, not 255. This may contribute to overflow issues.
 
====<span style="display:none;">0x3d - Set Texture Image ====
56

edits