Difference between revisions of "GPU/Commands"

< GPU
m (Replaced content with "Merged with GPU/Internal_Registers")
 
(205 intermediate revisions by 10 users not shown)
Line 1: Line 1:
βˆ’
This page describes the structure of the buffer for [[GSP_Shared_Memory|GX command]] 1 with the registers at [[GPU|0x1EF018E0]]. This buffer is used for GPU commands including OpenGL commands, each 8-byte entry in the buffer is a command. Cmd+0 is the command parameter, and cmd+4 is the command header.
+
Merged with [[GPU/Internal_Registers]]
βˆ’
 
 
βˆ’
=== Command Header ===
 
βˆ’
{| class="wikitable" border="1"
 
βˆ’
!  Bit
 
βˆ’
!  Description
 
βˆ’
|-
 
βˆ’
| 19-0
 
βˆ’
| Command ID
 
βˆ’
|-
 
βˆ’
| 30-20
 
βˆ’
| Total words following the command, if any.
 
βˆ’
|-
 
βˆ’
| 31
 
βˆ’
| ?
 
βˆ’
|}
 
βˆ’
The first word in the parameter data structure is the command parameter value, the rest of the data structure is from the data following the command. The word after the last data structure word is padding when needed for 8-byte alignment, for the following command.
 
βˆ’
 
 
βˆ’
=== Commands ===
 
βˆ’
{| class="wikitable" border="1"
 
βˆ’
!  CommandID
 
βˆ’
!  Parameter
 
βˆ’
!  Description
 
βˆ’
|-
 
βˆ’
| 0x000F0010
 
βˆ’
| Value is 0x12345678
 
βˆ’
| This command is always the last command in the buffer.
 
βˆ’
|-
 
βˆ’
| 0x000F0110
 
βˆ’
| Value 0x1
 
βˆ’
| This command is immediately before CmdID 0x000F0010, this is used elsewhere in the buffer as well.
 
βˆ’
|-
 
βˆ’
| 0x000F0111
 
βˆ’
| Value 0x1
 
βˆ’
| This command is immediately before CmdID 0x000F0110, however CmdID 0x000F0110 doesn't always follow this command.
 
βˆ’
|-
 
βˆ’
| 0x000F0040
 
βˆ’
| u32, valid values are 0x1 and 0x2, values 0x0 and 0x3 have the same effect as value 0x2. Only bits 1-0 are used.
 
βˆ’
| Disable/enable alpha testing. Parameter value 0x1 disables GL_ALPHA_TEST, while value 0x2 enables GL_ALPHA_TEST.
 
βˆ’
|-
 
βˆ’
| 0x000F0041
 
βˆ’
| float Z vector
 
βˆ’
| This sets Z scaling for the current matrix.
 
βˆ’
|-
 
βˆ’
| 0x000F0042
 
βˆ’
| float Y vector
 
βˆ’
| This sets Y scaling for the current matrix.
 
βˆ’
|-
 
βˆ’
| 0x000F0043
 
βˆ’
| float unknown
 
βˆ’
| ?
 
βˆ’
|-
 
βˆ’
| 0x000F0044
 
βˆ’
| float X vector
 
βˆ’
| This sets X scaling for the current matrix.
 
βˆ’
|-
 
βˆ’
| 0x801F004D
 
βˆ’
| First word in parameter structure
 
βˆ’
| ?
 
βˆ’
|-
 
βˆ’
| 0x000F02C0
 
βˆ’
| <nowiki>0x80000000 | CoordinateType</nowiki>
 
βˆ’
| This is used immediately before CmdID 0xXXXF02C1. This type field controls the command parameter buffer type.
 
βˆ’
|-
 
βˆ’
| 0xXXXF02C1
 
βˆ’
| First word in the first coordinate entry
 
βˆ’
| A list of coordinate entries follow this command.
 
βˆ’
|}
 
βˆ’
 
 
βˆ’
=== Coordinate Entry ===
 
βˆ’
{| class="wikitable" border="1"
 
βˆ’
!  Index Word
 
βˆ’
!  Description
 
βˆ’
|-
 
βˆ’
| 0
 
βˆ’
| float X coordinate
 
βˆ’
|-
 
βˆ’
| 1
 
βˆ’
| float Y coordinate
 
βˆ’
|-
 
βˆ’
| 2
 
βˆ’
| float Z coordinate
 
βˆ’
|}
 
βˆ’
 
 
βˆ’
=== Coordinate Types ===
 
βˆ’
{| class="wikitable" border="1"
 
βˆ’
!  Value
 
βˆ’
!  Entries per chunk
 
βˆ’
!  Description
 
βˆ’
|-
 
βˆ’
| 0x00
 
βˆ’
| 4
 
βˆ’
| Related to matrix translation?
 
βˆ’
|-
 
βˆ’
| 0x04
 
βˆ’
| 4
 
βˆ’
| Unknown, this is used immediately after type 0x00.
 
βˆ’
|-
 
βˆ’
| 0x08
 
βˆ’
| 2
 
βˆ’
| Sets the color for this object.
 
βˆ’
|-
 
βˆ’
| 0x0A
 
βˆ’
| 4
 
βˆ’
| Texture related?
 
βˆ’
|-
 
βˆ’
| 0x0B
 
βˆ’
| 3
 
βˆ’
| ?
 
βˆ’
|-
 
βˆ’
| 0x14
 
βˆ’
| <=30
 
βˆ’
| Matrix related?
 
βˆ’
|-
 
βˆ’
| 0x4C
 
βˆ’
| 4
 
βˆ’
| ?
 
βˆ’
|-
 
βˆ’
| 0x50, 0x53, and 0x56
 
βˆ’
| 1
 
βˆ’
| ?
 
βˆ’
|-
 
βˆ’
| 0x51, 0x54, and 0x57
 
βˆ’
| 1
 
βˆ’
| ?
 
βˆ’
|-
 
βˆ’
| 0x52, 0x55, and 0x58
 
βˆ’
| 1
 
βˆ’
| ?
 
βˆ’
|-
 
βˆ’
| 0x59
 
βˆ’
| 1
 
βˆ’
| Unknown, the entry data is floats converted from s32s.
 
βˆ’
|-
 
βˆ’
| 0x5A
 
βˆ’
| 2
 
βˆ’
| Color related?
 
βˆ’
|-
 
βˆ’
| 0x5C
 
βˆ’
| 1
 
βˆ’
| ?
 
βˆ’
|}
 

Latest revision as of 09:06, 5 December 2015