Reality Display Processor/Commands: Difference between revisions
Start Set Other Modes
(Set Combine Mode) |
(Start Set Other Modes) |
||
Line 705:
* The dz value provided should be a power of 2 to ensure correct operation. RDP hardware uses a cheap integer log2 algorithm for computing log2(dz) that is only guaranteed to produce correct results when the input is a power of 2. Notably, the value 0xFFFF happens to work correctly.
====<span style="display:none;">0x2f -
----
{| class="wikitable" style="text-align: center; white-space:nowrap;"
! colspan="17"|
|-
| 63:48 || — || — || colspan=6| command = 0x2f[5:0] ||
|-
| 47:32 ||
|-
| 31:16 || colspan=2|
|-
| 15:0 ||
|}
{{#invoke:Register table|definitions
| 61:56 | command[5:0] | 0x2f
| 55 | atomic_prim | Enables span buffer coherency, forces active span segments to be written to the frame buffer before reading new span segments
| 54 |
| 53:52 | cycle_type[1:0] | Determines pipeline mode. Either 1-Cycle (0), 2-Cycle (1), COPY (2), FILL (3)
| 51 | persp_tex_en | Enables perspective correction of texture coordinates
| 50 | detail_tex_en | Enables "detail texture" mode in Texture LOD
| 49 | sharpen_tex_en | Enables "sharpen texture" mode in Texture LOD
| 48 | tex_lod_en | Enables Texture Level of Detail (LOD)
| 47 | tlut_en | Enables Texture Look-Up Table (TLUT) sampling. Texels are first fetched from low TMEM that are then used to index a palette in high TMEM to find the final color values.
| 46 | tlut_type | Determines TLUT texel format. Either RGBA16 (0) or IA16 (1)
| 45 | sample_type | Determines texel sampling mode. Either point-sampled (0) or 2x2 bilinear (1)
| 44 | mid_texel | Determines bilinear filter mode. Either 3-point (0) or average mode (1)
| 43 | bi_lerp_0 | Determines texture filter mode for the first cycle. Either YUV to RGB conversion (See '''Set Convert''') (0) or bilinear filter (1)
| 42 | bi_lerp_1 | Determines texture filter mode for the second cycle. Either YUV to RGB conversion (See '''Set Convert''') (0) or bilinear filter (1)
| 41 | convert_one | Determines the input to the second texture filter stage. Either the sample from the second stage of texture sampling (0) or the result from the first texture filter cycle (1)
| 40 | key_en | Enables chroma keying following the Color Combiner stage
| 39:38 |
| 37:36 |
| 35:32 |
| 31:30 |
| 29:28 |
| 27:26 |
| 25:24 |
| 23:22 |
| 21:20 |
| 19:18 |
| 17:16 |
| 15 |
| 14 | force_blend | Enables blending for all pixels rather than only edge pixels
| 13 | alpha_cvg_select | Use coverage (or coverage multiplied by CC alpha) for alpha input to blender rather than alpha output from CC
| 12 | cvg_x_alpha | Multiply coverage and alpha from CC (used in conjunction with alpha_cvg_sel)
| 11:10 |
| 9:8 |
| 7 | color_on_cvg | If enabled, writes the blender output only if coverage overflowed, otherwise write the 2B input verbatim
| 6 | image_read_en | Enable color image reading
| 5 | z_update_en | Enable z-buffer writing
| 4 | z_compare_en | Enable z-buffer reading and depth comparison
| 3 | antialias_en | Enable anti-aliasing, which may enable blending on edge pixels
| 2 | z_source_sel | Selects either per-pixel (0) or primitive (1) depth as depth source to compare against the z-buffer
| 1 | dither_alpha_en | Determines alpha compare threshold source. (0 blend color register alpha, 1 random)
| 0 | alpha_compare_en | Enables alpha compare, pixels below the alpha threshold (compared against CC alpha output) are not written
}}
Configures the RDP "Other Modes", a collection of global settings.
'''RGB dither modes'''
{| class="wikitable"
! Value !! Description
|-
| 0 || 4x4 Magic Square dither matrix
|-
| 1 || 4x4 Bayer dither matrix
|-
| 2 || Random noise
|-
| 3 || Disabled, no dithering applied
|}
'''Alpha dither modes'''
{| class="wikitable"
! Value !! Description
|-
| 0 || Same pattern as chosen in RGB. If noise was chosen, use magic square. If RGB dither was disabled, use bayer.
|-
| 1 || Inverse of the same pattern as chosen in RGB. Same rules as above if RGB was noise or disabled.
|-
| 2 || Random noise
|-
| 3 || Disabled, no dithering applied
|}
'''Z modes'''
{| class="wikitable"
! Value !! Description
|-
| 0 || Opaque surface mode.
|-
| 1 || Interpenetrating surface mode.
|-
| 2 || Transparent surface mode.
|-
| 3 || Decal surface mode.
|}
'''Coverage destination modes'''
{| class="wikitable"
! Value !! Description
|-
| 0 || Clamp. Sums new and old coverage, clamps to full if there is an overflow.
|-
| 1 || Wrap. Sums new and old coverage, writes this sum modulo 8.
|-
| 2 || Full. Always write full coverage.
|-
| 3 || Save. Always write old coverage, discard new coverage. Requires image_read_en, otherwise it will behave like Full.
|}
'''Blender Configuration'''
Other modes include the blender input configuration. The blender computes either
<math>p \cdot a + m \cdot b</math>
or
<math>\frac{p \cdot a + m \cdot b}{a + b}</math>
The latter is performed only when force_blend is disabled and anti-aliasing is enabled, where it is performed only on edge pixels.
'''Blender P and M Inputs'''
{| class="wikitable"
! Value !! Description
|-
| 0 || First cycle: output color from Color Combiner final stage; Second cycle: output color from first blender cycle
|-
| 1 || Memory color from framebuffer
|-
| 2 || Blend color register RGB
|-
| 3 || Fog color register RGB
|}
'''Blender A Inputs'''
{| class="wikitable"
! Value !! Description
|-
| 0 || Output alpha from Color Combiner final stage
|-
| 1 || Fog color register Alpha
|-
| 2 || Shade Alpha (interpolated per-pixel)
|-
| 3 || Fixed 0.0
|}
'''Blender B Inputs'''
{| class="wikitable"
! Value !! Description
|-
| 0 || 1.0 - A, where A is the other alpha input
|-
| 1 || Memory coverage from framebuffer
|-
| 2 || Fixed 1.0
|-
| 3 || Fixed 0.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 other modes configuration and the new other modes configuration.
* Blender hazards:
** If memory color was set as a blender input, image_read_en should be enabled for proper operation.
** If memory coverage was set as a blender input, image_read_en should be enabled for proper operation. If it is left disabled, memory coverage is set to full.
** 2-Cycle mode pipeline bug: In the first cycle of 2-cycle mode, memory color is read from the previous pixel.
** 2-Cycle mode pipeline bug: In the first cycle of 2-cycle mode, memory coverage is read from the previous pixel.
** 2-Cycle mode pipeline bug: In the second cycle of 2-cycle mode, shade alpha is read from the next pixel.
====<span style="display:none;">0x30 - Load_Texture_LUT ====
|