Changes

Jump to navigation Jump to search
2,447 bytes removed ,  08:01, 5 December 2015
no edit summary
Line 1: Line 1: −
This page describes the [[GPU_Commands|GPU commands]] used for OpenGL arrays. See [[GPU/Internal_Registers|here]] for more information.
+
This page describes the [[GPU_Commands|GPU commands]] used for OpenGL arrays.
   −
==== Command Sets ====
+
== Command Sets ==
   −
===== glDrawElements() =====
+
=== glDrawElements() ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Command Index
 
!  Command Index
CommandID
+
Register
!  Parameter
   
!  Description
 
!  Description
 
|-
 
|-
 
| 0
 
| 0
| 0x0229
+
| [[GPU/Internal_Registers#GPUREG_GEOSTAGE_CONFIG|GPUREG_GEOSTAGE_CONFIG]]
| u32, val<<8.
+
| Set whether drawing triangle elements.
| Unknown, val is 0 or 1.
   
|-
 
|-
 
| 1-2
 
| 1-2
| 0x0253
+
| [[GPU/Internal_Registers#GPUREG_GEOSTAGE_CONFIG2|GPUREG_GEOSTAGE_CONFIG2]]
| Same as command 0x0229.
+
| Set whether drawing triangle elements.
| Unknown
   
|-
 
|-
 
| 3
 
| 3
| 0x025E
+
| [[GPU/Internal_Registers#GPUREG_PRIMITIVE_CONFIG|GPUREG_PRIMITIVE_CONFIG]]
| u32, val<<8.
+
| Set primitive mode.
| This sets the GL rendering mode.
   
|-
 
|-
 
| 4
 
| 4
| 0x025E
+
| [[GPU/Internal_Registers#GPUREG_PRIMITIVE_CONFIG|GPUREG_PRIMITIVE_CONFIG]]
| Value 0
+
| Set number of output map registers
| ?
   
|-
 
|-
 
| 5
 
| 5
| 0x025F
+
| [[GPU/Internal_Registers#GPUREG_RESTART_PRIMITIVE|GPUREG_RESTART_PRIMITIVE]]
| Value 1
+
| Trigger reset
| ?
   
|-
 
|-
 
| 6
 
| 6
| 0x0253
+
| [[GPU/Internal_Registers#GPUREG_GEOSTAGE_CONFIG2|GPUREG_GEOSTAGE_CONFIG2]]
| Value 0
+
| Set function indicator to 0
| ?
   
|-
 
|-
 
| 7
 
| 7
| 0x0227
+
| [[GPU/Internal_Registers#GPUREG_INDEXBUFFER_CONFIG|GPUREG_INDEXBUFFER_CONFIG]]
| u32
+
| Set offset and type
| This specifies the indices data-type, and the indices array address.
   
|-
 
|-
 
| 8
 
| 8
| 0x0228
+
| [[GPU/Internal_Registers#GPUREG_NUMVERTICES|GPUREG_NUMVERTICES]]
| u32
+
| Set vertex count
| This specifies the number of elements in the array to use for rendering.
   
|-
 
|-
 
| 9
 
| 9
| 0x0245
+
| [[GPU/Internal_Registers#GPUREG_START_DRAW_FUNC0|GPUREG_START_DRAW_FUNC0]]
| Value 0
+
| Set mode to drawing
| ?
   
|-
 
|-
 
| 10
 
| 10
| 0x022F
+
| [[GPU/Internal_Registers#GPUREG_DRAWELEMENTS|GPUREG_DRAWELEMENTS]]
| Value 1
+
| Trigger draw
| ?
   
|-
 
|-
 
| 11
 
| 11
| 0x0245
+
| [[GPU/Internal_Registers#GPUREG_START_DRAW_FUNC0|GPUREG_START_DRAW_FUNC0]]
| Value 1
+
| Set mode to configuration
| ?
   
|-
 
|-
 
| 12
 
| 12
| 0x0231
+
| [[GPU/Internal_Registers#GPUREG_VTX_FUNC|GPUREG_VTX_FUNC]]
| Value 1
+
| Trigger post-vertex cache clear
| ?
   
|-
 
|-
 
| 13
 
| 13
| 0x0111
+
| [[GPU/Internal_Registers#GPUREG_FRAMEBUFFER_FLUSH|GPUREG_FRAMEBUFFER_FLUSH]]
| Value 1
+
| Flush framebuffer
| ?
   
|-
 
|-
 
| 14
 
| 14
| 0x0229
+
| [[GPU/Internal_Registers#GPUREG_GEOSTAGE_CONFIG|GPUREG_GEOSTAGE_CONFIG]]
| Value 0
+
| Clear drawing triangle elements
| ?
   
|-
 
|-
 
| 15
 
| 15
| 0x0253
+
| [[GPU/Internal_Registers#GPUREG_GEOSTAGE_CONFIG2|GPUREG_GEOSTAGE_CONFIG2]]
| Value 0
+
| Clear drawing triangle elements
| ?
   
|-
 
|-
 
| 16
 
| 16
| 0x025E
+
| [[GPU/Internal_Registers#GPUREG_PRIMITIVE_CONFIG|GPUREG_PRIMITIVE_CONFIG]]
| Value 0
+
| Clear primitive mode
| ?
   
|-
 
|-
 
| 17
 
| 17
| 0x02BA
+
| [[GPU/Internal_Registers#GPUREG_VSH_ENTRYPOINT|GPUREG_VSH_ENTRYPOINT]]
| Value 0x7FFF0000
+
| Clear entry point
| ?
   
|}
 
|}
  −
===== Command 0x0200 =====
  −
{| class="wikitable" border="1"
  −
!  Command Index
  −
!  CommandID
  −
!  Parameter
  −
!  Description
  −
|-
  −
| 0
  −
| 0x0200
  −
|
  −
| This sets the addresses for the GL arrays.
  −
|-
  −
| 1
  −
| 0x02BB
  −
|
  −
| ?
  −
|-
  −
| 2
  −
| 0x0232
  −
|
  −
| Unknown, this command is used multiple times for specifying each parameter-buffer entry.
  −
|}
  −
  −
=== GL mode values for command 0x025E ===
  −
{| class="wikitable" border="1"
  −
!  Value
  −
!  Description
  −
|-
  −
| 0
  −
| GL_TRIANGLES
  −
|-
  −
| 1
  −
| GL_TRIANGLE_STRIP
  −
|-
  −
| 2
  −
| GL_TRIANGLE_FAN
  −
|-
  −
| 3
  −
| Unknown. An unconfirmed theory is that this is used for variable-size primitives (GL_SUBD_PRIM_DMP/GL_GEOMETRY_PRIMITIVE_DMP), for which the index buffer format is altered slightly (each sequence of indices constituting a primitive is prepended a number indicating the primitive size).
  −
|-
  −
| 4
  −
| Unknown, this seems to have the same effect as value 0.
  −
|}
  −
  −
=== Parameter value format for command 0x0227 ===
  −
{| class="wikitable" border="1"
  −
!  Bit
  −
!  Description
  −
|-
  −
| 30-0
  −
| Indices array address, relative to base set with command 0x0200.
  −
|-
  −
| 31
  −
| 0 = indices data-type GL_UNSIGNED_BYTE, 1 = GL_UNSIGNED_SHORT.
  −
|}
  −
  −
=== Parameter structure for command 0x0200 ===
  −
{| class="wikitable" border="1"
  −
!  Index Word
  −
!  Description
  −
|-
  −
| 0x0
  −
| Base physical address >> 3, normally located in VRAM. The address must be aligned to a 16-byte boundary.
  −
|-
  −
| 0x1
  −
| Every 4 bits is used for specifying the array data-type and size for each entry.
  −
|-
  −
| 0x2
  −
| Value is: <nowiki>(0xF0000000 + (val<<28)) | ((attrib_mask & 0xFFF)<<16)</nowiki>, where val is the total 4-bit value entries for the command 0x801F02BB parameter buffer.(Normally val is 8); attrib_mask is usually (0xFFF<<totalentries)
  −
|-
  −
| 0x3-0x26
  −
| 12 entries, each entry is 3 words.
  −
|}
  −
  −
These parameters and the entries' parameters are set by gl*Pointer().
  −
  −
==== Entry structure ====
  −
{| class="wikitable" border="1"
  −
!  Index Word
  −
!  Description
  −
|-
  −
| 0
  −
| Physical address, relative to the base address.
  −
|-
  −
| 1
  −
| Entry attribute permutation (lower 8 bytes)
  −
|-
  −
| 2
  −
| Value is: <nowiki>((numattrib)<<28 | (stride<<16) | ((attrib_permuation>>32)&0xFFFF).</nowiki> (stride in bytes)
  −
|}
  −
  −
A given entry corresponds to a buffer, but a single buffer may contain attributes of multiple different interlaced attributes, hence the attribute permutation parameter which lists the various attributes that can be found in the buffer, and in which order. If stride doesn't exactly match the format, the GPU may hang.
  −
When the entry is unused, the entry data is all-zero.
  −
  −
===== Array data-type/size values =====
  −
{| class="wikitable" border="1"
  −
!  Value
  −
!  GL type
  −
|-
  −
| 0x0 + ((size-1)*4)
  −
| GL_BYTE
  −
|-
  −
| 0x1 + ((size-1)*4)
  −
| GL_UNSIGNED_BYTE
  −
|-
  −
| 0x2 + ((size-1)*4)
  −
| GL_UNSIGNED_SHORT/GL_SHORT
  −
|-
  −
| 0x3 + ((size-1)*4)
  −
| GL_FLOAT
  −
|}
  −
  −
Size is 1-4. Using GL_FLOAT with a texture coordinates array causes the GPU to hang?
  −
  −
=== Parameter structure for command 0x02BB ===
  −
{| class="wikitable" border="1"
  −
!  Index Word
  −
!  Description
  −
|-
  −
| 0-1
  −
| u64, every 4-bits is a value from some array.
  −
|}
  −
  −
=== Parameter structure for command 0x0232 ===
  −
{| class="wikitable" border="1"
  −
!  Index Word
  −
!  Description
  −
|-
  −
| 0
  −
| Entry index + total command 0x0200 parameter-buffer entries.
  −
|-
  −
| 1
  −
| Unknown, usually value 0x3F000000 / 0.5f.(u32 read/writes are used for this field, not float read/writes however)
  −
|-
  −
| 2
  −
| Unknown, usually value 0.
  −
|-
  −
| 3
  −
| Unknown, usually value 0.
  −
|}
  −
  −
Each parameter buffer for command 0x0232 is an entry loaded from an array.
  −
4 float24 values ?
      
[[Category:GPU]]
 
[[Category:GPU]]
1,434

edits

Navigation menu