Reality Display Processor/Commands: Difference between revisions

Set Color Image
(Add an opcode table, use bold formatting (rather than header formatting) for "Word *" in multi-word commands to keep them out of the TOC)
(Set Color Image)
Line 984:
----
{| class="wikitable" style="text-align: center; white-space:nowrap;"
! colspan="17"|Set_Color_ImageSet Color Image <code>0x3f</code>
|-
| 63:48 || — || — || colspan=6| command = 0x3f[5:0] || colspan=3| set.color.format[2:0] || colspan=2| set.color.size[1:0] || — || — || —
|-
| 47:32 || — || — || — || — || — || — || colspan=10| set.color.width[9:0]
|-
| 31:16 || — || — || — || — || — || — || colspan=10| set.color.dramAddress[25:16]
|-
| 15:0 || colspan=16| set.color.dramAddress[15:0]
|}
{{#invoke:Register table|definitions
| 61:56 | command[5:0] | 0x3f
| 55:53 | set.color.format[2:0] | -Pixel format (same meaning as in texture format)
| 52:51 | set.color.size[1:0] | -Pixel size (same meaning as in texture size)
| 41:32 | set.color.width[9:0] | Image width in pixels (-1) (possible range of 1 to 4096 pixels)
| 25:0 | set.color.dramAddress[25:0] | -RDRAM Physical Address of the buffer where pixels will be written
}}
 
Sets the color image address and properties, the region in RDRAM where primitives will be rendered to as pixels.
 
The image is arrayed in row-order, that is rows are adjacent in memory. It is generally more efficient to draw wide triangles rather than horizontally thin triangles that overlap many rows; for single rows span buffers are employed to alleviate stalls due to waiting on memory read/write requests while there is no such buffering across multiple rows.
 
Valid format/size combinations are RGBA32, RGBA16, I8. 4-bit modes only write 0s as bytes, all 8-bit modes behave identically, 16-bit and 32-bit RGBA modes differ from other modes.
 
'''Hazards'''
* This attribute must be set before rendering any primitives, else it will render to an unspecified location.
* This is an attribute-setting command that requires pipeline synchronization before use, otherwise currently rendering primitives may be split partially between the old color image and new color image. (TOVERIFY there are conflicting accounts of whether Set Color Image requires a sync, the current consensus is that sync is required to avoid all edge cases)
* Memory alignment must be 64-byte for all rendering operations to behave as expected.
* Rendering any primitive in FILL mode to a 4-bit color image will crash the RDP.
* Copying a 4-bit or 8-bit texture with COPY mode is only possible if the destination color image is 8-bit.
* Copying a 16-bit texture with COPY mode is only possible if the destination color image is 16-bit. (Note that CI textures are treated as 16-bit in COPY mode as the TLUT is 16-bit)
* COPY mode is unavailable when a 32-bit color image is configured.
56

edits