Reality Display Processor/Commands: Difference between revisions

Set Scissor
(Fill Rectangle)
(Set Scissor)
Line 549:
}}
 
====<span style="display:none;">0x2d - Set_ScissorSet Scissor ====
----
{| class="wikitable" style="text-align: center; white-space:nowrap;"
! colspan="17"|Set_ScissorSet Scissor <code>0x2d</code>
|-
| 63:48 || — || — || colspan=6| command = 0x2d[5:0] || colspan=8| scissorupper_left.x.hi[11:4]
|-
| 47:32 || colspan=4| scissorupper_left.x.hi[3:0] || colspan=12| scissorupper_left.y.hi[11:0]
|-
| 31:16 || — || — || — || — || — || — || scissor.field || scissor.odd || colspan=8| scissorlower_right.x.lo[11:4]
|-
| 15:0 || colspan=4| scissor.x.lo[3:0] || colspan=12| scissorlower_right.y.lo[11:0]
|}
{{#invoke:Register table|definitions
| 61:56 | command[5:0] | 0x2d
| 55:44 | scissorupper_left.x.hi[11:0] | -Upper left x coordinate (u10.2 format)
| 43:32 | scissorupper_left.y.hi[11:0] | -Upper left y coordinate (u10.2 format)
| 25 | field | Whether to perform interlaced rendering, only even or odd lines will be processed
| 25 | scissor.field | ?
| 24 | odd | Whether to keep even (0) or odd (1) lines when interlaced rendering is enabled
| 24 | scissor.odd | ?
| 23:12 | scissorlower_right.x.lo[11:0] | -Lower right x coordinate (u10.2 format)
| 11:0 | scissorlower_right.y.lo[11:0] | -Lower right y coordinate (u10.2 format)
}}
 
Sets the scissor region, pixels that are outside of this region will not be processed in the pixel pipeline and will not be written to memory. Note that only the scissor determines this, the color image width has no effect. Typically the scissor width should not be larger than the color image width.
 
The RDP is capable of efficiently rejecting pixels that lie outside the left, right and lower scissor boundaries at no cost in time. The same cannot be said of pixels lying above the scissor region: for every line for which a primitive extends above the scissor region the RDP spends one cycle advancing each line, since it must update the attribute start values for each line.
 
'''Hazards'''
* The scissor region is '''inclusive''' on the lower-right edges in FILL and COPY modes, while it is '''exclusive''' on the lower-right edges in 1-Cycle and 2-Cycle modes.
* The scissor region must be configured before rendering anything. There is no way to disable the scissor, if it is not configured it will use whatever configuration was last in the registers.
* In COPY mode, upper_left.x should be 0 (TOVERIFY Is this always true? It appears to be an unavoidable crash, but needs further investigation)
* In COPY mode, lower_right.x should be a multiple of 4 pixels (-1) to prevent possible memory corruption
* In FILL mode, upper_left.x and lower_right.x should be multiples of 4 pixels (-1 for lower_right.x) to prevent possible memory corruption
* FILL mode triangles interact bizarrely with the scissor bounds, avoid drawing such triangles that extend off-screen (TODO understand this better)
* In FILL mode sometimes scissor works at the level of individual pixels while sometimes it only works at 4-pixel boundaries. (TODO understand this better, probably to do with memory alignment)
 
====<span style="display:none;">0x2e - Set Primitive Depth ====
56

edits