Reality Display Processor/Commands: Difference between revisions

Set Tile, Set Tile Size
m (fix edit-o, and synchronize bit widths across tables)
(Set Tile, Set Tile Size)
Line 767:
}}
 
====<span style="display:none;">0x32 - Set_Tile_SizeSet Tile Size ====
----
{| class="wikitable" style="text-align: center; white-space:nowrap;"
! colspan="17"|Set_Tile_SizeSet Tile Size <code>0x32</code>
|-
| 63:48 || — || — || colspan=6| command = 0x32[5:0] || colspan=8| tileSizeupper_left.s.lo[11:4]
|-
| 47:32 || colspan=4| tileSizeupper_left.s.lo[3:0] || colspan=12| tileSizeupper_left.t.lo[11:0]
|-
| 31:16 || — || — || — || — || — || colspan=3| tileSize.index[2:0] || colspan=8| tileSizelower_right.s.hi[11:4]
|-
| 15:0 || colspan=4| tileSizelower_right.s.hi[3:0] || colspan=12| tileSizelower_right.t.hi[11:0]
|}
{{#invoke:Register table|definitions
| 61:56 | command[5:0] | 0x32
| 55:44 | tileSizeupper_left.s.lo[11:0] | -(u10.2 format)
| 43:32 | tileSizeupper_left.t.lo[11:0] | -(u10.2 format)
| 26:24 | tileSize.index[2:0] | -Tile index
| 23:12 | tileSizelower_right.s.hi[11:0] | -(u10.2 format)
| 11:0 | tileSizelower_right.t.hi[11:0] | -(u10.2 format)
}}
 
Updates the tile extents for the tile descriptor specified by the index parameter.
 
The upper-left coordinate specifies the origin of the tile, where texture coordinates (0,0) would sample from, and sets the lower extents for clamp/mask/mirror in texture sampling.
 
The lower-right coordinate specifies the upper extents for clamp/mask/mirror in texture sampling.
 
====<span style="display:none;">0x33 - Load_Block ====
Line 833 ⟶ 839:
}}
 
====<span style="display:none;">0x35 - Set_TileSet Tile ====
----
{| class="wikitable" style="text-align: center; white-space:nowrap;"
! colspan="17"|Set_TileSet Tile <code>0x35</code>
|-
| 63:48 || — || — || colspan=6| command = 0x35[5:0] || colspan=3| tile.format[2:0] || colspan=2| tile.size[1:0] || — || colspan=2| tile.line[8:7]
|-
| 47:32 || colspan=7| tile.line[6:0] || colspan=9| tile.address[8:0]
|-
| 31:16 || — || — || — || — || — || colspan=3| tile.index[2:0] || colspan=4| tile.palette[3:0] || tile.t.clampclamp_T || tile.t.mirrormirror_T || colspan=2| tile.t.maskmask_T[3:2]
|-
| 15:0 || colspan=2| tile.t.maskmask_T[1:0] || colspan=4| tile.t.shiftshift_T[3:0] || tile.s.clampclamp_S || tile.s.mirrormirror_S || colspan=4| tile.s.maskmask_S[3:0] || colspan=4| tile.s.shiftshift_S[3:0]
|}
{{#invoke:Register table|definitions
| 61:56 | command[5:0] | 0x35
| 55:53 | tile.format[2:0] | -Tile texel format
| 52:51 | tile.size[1:0] | -Tile texel size
| 49:41 | tile.line[8:0] | -Tile line length in TMEM words
| 40:32 | tile.address[8:0] | -TMEM address in TMEM words
| 26:24 | tile.index[2:0] | -Tile index
| 23:20 | tile.palette[3:0] | -Palette index
| 19 | tile.t.clampclamp_T | ?Clamp enable (T-axis)
| 18 | tile.t.mirrormirror_T | ?Mirror enable (T-axis)
| 17:14 | tile.t.maskmask_T[3:0] | Mask (T-axis)
| 13:10 | tile.t.shiftshift_T[3:0] | Shift (T-axis)
| 9 | tile.s.clampclamp_S | ?Clamp enable (S-axis)
| 8 | tile.s.mirrormirror_S | ?Mirror enable (S-axis)
| 7:4 | tile.s.maskmask_S[3:0] | Mask (S-axis)
| 3:0 | tile.s.shiftshift_S[3:0] | Shift (S-axis)
}}
 
Configures the tile descriptor specified by the index parameter.
 
The texel '''format''' parameter is selected from
{| class="wikitable"
! Format Name !! Format Value
|-
| RGBA || 0
|-
| YUV || 1
|-
| Color-Indexed (CI) || 2
|-
| Intensity-Alpha (IA) || 3
|-
| Intensity (I) || 4+
|}
 
The texel '''size''' parameter is selected from
{| class="wikitable"
! Bits per pixel !! Size Value
|-
| 4 || 0
|-
| 8 || 1
|-
| 16 || 2
|-
| 32 || 3
|}
 
Officially supported format/size combinations
{| class="wikitable" style="text-align: center; white-space:nowrap;"
! !! RGBA !! YUV !!CI !! IA !! I
|-
| '''4''' || - || - || {{tick|color=black}} || {{tick|color=black}} || {{tick|color=black}}
|-
| '''8''' || - || - || {{tick|color=black}} || {{tick|color=black}} || {{tick|color=black}}
|-
| '''16''' || {{tick|color=black}} || {{tick|color=black}} || - || {{tick|color=black}} || -
|-
| '''32''' || {{tick|color=black}} || - || - || - || -
|}
 
The '''line''' parameter indicates the number of TMEM (64-bit) words in a single row of the tile. This quantity is typically calculated from the tile width in texels and texel size as <code>(width * NBITS(size) + 63) / 64</code> where <code>NBITS(size)</code> is the number of bits per texel. If a texture width is not an integral number of TMEM words, each row must be padded to begin on a new TMEM word; Load Tile performs this padding transparently when loading texture data from RDRAM into TMEM, for Load Block the data must already be padded in RDRAM.
 
The '''address''' is a TMEM word (64-bit) address. For example an address of 0x100 resolves to byte address 0x800, half way through TMEM.
 
The '''palette''' parameter is for CI4 formatted tiles, for CI formats of other sizes it is ignored altogether. It is the upper half of a TMEM address, indicating where the tile can find the associated color palette. The lower half of the TMEM address is populated by the color index in the CI4 texture data.
 
The '''clamp/mirror/mask/shift''' parameters for each texture coordinate axis influence how texels are sampled from the tile during texture sampling. (TODO link texture sampling article)
* '''clamp''': Enables clamping. When the tile is sampled with coordinates that fall outside the tile boundaries, the nearest texel that is within the tile bounds will be used. If disabled, coordinates are brought into the tile range by wrapping based on the mask value, which operates on powers of 2. Therefore, if a tile extent is not a power of 2 clamping should typically be used.
* '''mirror''': Enables mirroring. When oversampling the tile, flip the axis.
* '''mask''': Determines how many bits of the integer part of the texture coordinate should be considered for sampling from this tile. A mask of 0 indicates all bits should be considered.
* '''shift''': Optional shift amount for texture coordinates. Values 1-10 shift right while 11-15 shift left.
{| class="wikitable" style="text-align: center; white-space:nowrap;"
! Shift value !! Operation
|-
| 0 || N/A
|-
| 1 || >> 1
|-
| 2 || >> 2
|-
| colspan=2| ...
|-
| 10 || >> 10
|-
| 11 || << 5
|-
| 12 || << 4
|-
| 13 || << 3
|-
| 14 || << 2
|-
| 15 || << 1
|}
 
====<span style="display:none;">0x36 - Fill Rectangle ====
56

edits