Reality Display Processor/Commands: Difference between revisions

Texture Rectangle
(Add No Operation, Remove Invalid_31)
(Texture Rectangle)
Line 397:
}}
 
====<span style="display:none;">0x24 and 0x25 - Texture_RectangleTexture Rectangle ====
----
{| class="wikitable" style="text-align: center; white-space:nowrap;"
! colspan="18"|Texture_RectangleTexture Rectangle <code>0x24</code> and Texture_Rectangle_FlipTexture Rectangle Flip <code>0x25</code>
|-
| rowspan="4"|Word 0 || 63:48 || — || — || colspan=6| command[5:0] = 0x24 or 0x25 || colspan=8| x.lolrx[11:4]
|-
| 47:32 || colspan=4| x.lolrx[3:0] || colspan=12| y.lolry[11:0]
|-
| 31:16 || — || — || — || — || — || colspan=3| tile[2:0] || colspan=8| x.hiulx[11:4]
|-
| 15:0 || colspan=4| x.hiulx[3:0] || colspan=12| y.hiuly[11:0]
|-
| rowspan="4"|Word 1 || 63:48 || colspan=16| s.i[15:0]
|-
| 47:32 || colspan=16| t.i[15:0]
|-
| 31:16 || colspan=16| s.fdsdx[15:0]
|-
| 15:0 || colspan=16| t.fdtdy[15:0]
|}
 
Line 422:
{{#invoke:Register table|definitions
| 61:56 | command[5:0] | 0x24 (Texture_Rectangle) or 0x25 (Texture_Rectangle_Flip)
| 55:44 | x.lolrx[11:0] | Lower-right x screen coordinate (u10.2 format)
| 43:32 | y.lolry[11:0] | Lower-right y screen coordinate (u10.2 format)
| 26:24 | tile[2:0] | -Tile descriptor index
| 23:12 | x.hiulx[11:0] | Upper-left x screen coordinate (u10.2 format)
| 11:0 | y.hiuly[11:0] | Upper-left y screen coordinate (u10.2 format)
}}
'''Word 1'''
{{#invoke:Register table|definitions
| 63:48 | s.i[15:0] | Upper-left s coordinate (s10.5 format)
| 47:32 | t.i[15:0] | Upper-left t coordinate (s10.5 format)
| 31:16 | s.fdsdx[15:0] | -Change in s per x (s5.10 format)
| 15:0 | t.fdtdy[15:0] | -Change in t per y (s5.10 format)
}}
 
Renders a textured rectangle between upper-left coordinate '''(ulx,uly)''' and lower-right coordinate '''(lrx,lry)''', sampling texels using the tile descriptor indexed by '''tile'''. The coordinates '''(s,t)''' are the texture coordinates for the pixel at '''(ulx,uly)''', the derivatives '''dsdx''' and '''dtdy''' are added to these initial coordinates to determine the texture coordinates for every other pixel.
 
The screen coordinates are subpixel precise, integer values correspond to single pixels. In COPY and FILL mode the fractional bits are ignored and the lower-right bounds are inclusive, while in 1-Cycle and 2-Cycle modes the lower-right bounds are exclusive.
 
In COPY mode, since several pixels are written per cycle the '''dsdx''' parameter must account for this. It should be set such that it steps 64-bits worth of texels at a time, for example for a 16-bit color image it should be set to 4.0(s10.5) so that the s coordinate is incremented by 4 pixels (64 bits).
 
In FILL mode this behaves identically to '''Fill Rectangle''', the texturing properties are ignored.
 
Internally, this command is equivalent to a left-major triangle where <code>dxhdy = dxmdy = dxldy = 0, yl = ym = lry, yh = uly, xl = xm = lrx, xh = ulx</code>
 
'''Hazards'''
* In 1-Cycle and 2-Cycle mode using attributes such as shade color and per-pixel depth may be ill-defined. (TOVERIFY: It's either always 0 or uses the last value from previous primitives, check which)
 
====<span style="display:none;">0x26 - Sync Load ====
Line 980 ⟶ 993:
 
In FILL mode, the rectangle is rendered without subpixel accuracy (upper-left coordinates are rounded down, lower-right coordinates are rounded up) and the color is determined solely by the fill color register.
 
Internally, this command is equivalent to a left-major triangle where <code>dxhdy = dxmdy = dxldy = 0, yl = ym = lry, yh = uly, xl = xm = lrx, xh = ulx</code>
 
'''Hazards'''
56

edits