Changes

Jump to navigation Jump to search
12,860 bytes removed ,  04:23, 5 December 2015
m
This register is used to transfer shader operand descriptor data. This register behaves as a FIFO queue: each write to this register writes the provided value to the GPU shader operand descriptor memory bank at the offset initially set by [[#GPUREG_SH_OPDESCS_INDEX|GPUREG_''SH''_OPDESCS_INDEX]]. The offset in question is incremented after each write to this register.
 
== Vertex shader registers ==
 
=== GPUREG_VSH_BOOLUNIFORM ===
 
{| class="wikitable" border="1"
! Bits
! Description
|-
| 0
| unsigned, Value of vertex shader unit's b0 boolean register. (0=true, 1=false)
|-
| 1
| unsigned, Value of vertex shader unit's b1 boolean register. (0=true, 1=false)
|-
| 2
| unsigned, Value of vertex shader unit's b2 boolean register. (0=true, 1=false)
|-
| 3
| unsigned, Value of vertex shader unit's b3 boolean register. (0=true, 1=false)
|-
| 4
| unsigned, Value of vertex shader unit's b4 boolean register. (0=true, 1=false)
|-
| 5
| unsigned, Value of vertex shader unit's b5 boolean register. (0=true, 1=false)
|-
| 6
| unsigned, Value of vertex shader unit's b6 boolean register. (0=true, 1=false)
|-
| 7
| unsigned, Value of vertex shader unit's b7 boolean register. (0=true, 1=false)
|-
| 8
| unsigned, Value of vertex shader unit's b8 boolean register. (0=true, 1=false)
|-
| 9
| unsigned, Value of vertex shader unit's b9 boolean register. (0=true, 1=false)
|-
| 10
| unsigned, Value of vertex shader unit's b10 boolean register. (0=true, 1=false)
|-
| 11
| unsigned, Value of vertex shader unit's b11 boolean register. (0=true, 1=false)
|-
| 12
| unsigned, Value of vertex shader unit's b12 boolean register. (0=true, 1=false)
|-
| 13
| unsigned, Value of vertex shader unit's b13 boolean register. (0=true, 1=false)
|-
| 14
| unsigned, Value of vertex shader unit's b14 boolean register. (0=true, 1=false)
|-
| 15
| unsigned, Value of vertex shader unit's b15 boolean register. (0=true, 1=false)
|-
| 16-31
| Unknown. This seems to always be set to 0x7FFF, and other values may cause the GPU to hang
|}
 
This register is used to set the vertex shader unit's boolean registers.
 
=== GPUREG_VSH_INTUNIFORM_I0 ===
 
{| class="wikitable" border="1"
! Bits
! Description
|-
| 0-7
| unsigned, Value for vertex shader's i0.x
|-
| 8-15
| unsigned, Value for vertex shader's i0.y
|-
| 16-23
| unsigned, Value for vertex shader's i0.z
|-
| 24-31
| unsigned, Value for vertex shader's i0.w
|}
 
This register is used to set the vertex shader's i0 integer register.
 
=== GPUREG_VSH_INTUNIFORM_I1 ===
 
{| class="wikitable" border="1"
! Bits
! Description
|-
| 0-7
| unsigned, Value for vertex shader's i1.x
|-
| 8-15
| unsigned, Value for vertex shader's i1.y
|-
| 16-23
| unsigned, Value for vertex shader's i1.z
|-
| 24-31
| unsigned, Value for vertex shader's i1.w
|}
 
This register is used to set the vertex shader's i1 integer register.
 
=== GPUREG_VSH_INTUNIFORM_I2 ===
 
{| class="wikitable" border="1"
! Bits
! Description
|-
| 0-7
| unsigned, Value for vertex shader's i2.x
|-
| 8-15
| unsigned, Value for vertex shader's i2.y
|-
| 16-23
| unsigned, Value for vertex shader's i2.z
|-
| 24-31
| unsigned, Value for vertex shader's i2.w
|}
 
This register is used to set the vertex shader's i2 integer register.
 
=== GPUREG_VSH_INTUNIFORM_I3 ===
 
{| class="wikitable" border="1"
! Bits
! Description
|-
| 0-7
| unsigned, Value for vertex shader's i3.x
|-
| 8-15
| unsigned, Value for vertex shader's i3.y
|-
| 16-23
| unsigned, Value for vertex shader's i3.z
|-
| 24-31
| unsigned, Value for vertex shader's i3.w
|}
 
This register is used to set the vertex shader's i3 integer register.
 
=== GPUREG_VSH_INPUTBUFFER_CONFIG ===
 
{| class="wikitable" border="1"
! Bits
! Description
|-
| 0-7
| unsigned, Input buffer stride minus 1, in float vec4 registers. (value 0 means a stride of 1 float vec4 register)
|-
| 8-23
| Unknown. These bits typically aren't updated by games.
|-
| 24-31
| Unknown. This is typically set to 0xA for vertex shaders.
|}
 
This register is used to configure the vertex shader's input buffer. In the context of a geometry shader, the stride parameter can be interpreted as the number of attributes per vertex.
 
=== GPUREG_VSH_ENTRYPOINT ===
 
{| class="wikitable" border="1"
! Bits
! Description
|-
| 0-15
| unsigned, Vertex shader entrypoint, in words.
|-
| 16-31
| Unknown. This seems to always be set to 0x7FFF, and other values may cause the GPU to hang
|}
 
This sets the entrypoint for the program running on shader units set to vertex shader mode. Depending on the current geometry stage mode this can include either all 4 shader units or just 3 of them.
 
=== GPUREG_VSH_ATTRIBUTES_PERMUTATION_LOW ===
 
{| class="wikitable" border="1"
! Bits
! Description
|-
| 0-3
| unsigned, Index of vertex shader input register which the 1st attribute will be stored in.
|-
| 4-7
| unsigned, Index of vertex shader input register which the 2nd attribute will be stored in.
|-
| 8-11
| unsigned, Index of vertex shader input register which the 3rd attribute will be stored in.
|-
| 12-15
| unsigned, Index of vertex shader input register which the 4th attribute will be stored in.
|-
| 16-19
| unsigned, Index of vertex shader input register which the 5th attribute will be stored in.
|-
| 20-23
| unsigned, Index of vertex shader input register which the 6th attribute will be stored in.
|-
| 24-27
| unsigned, Index of vertex shader input register which the 7th attribute will be stored in.
|-
| 28-31
| unsigned, Index of vertex shader input register which the 8th attribute will be stored in.
|}
 
This register sets the vertex shader input register index which will correspond to each attribute contained by the input buffer for the first 8 attributes.
For example, having bits 0-3 set to 5 means that, in the vertex shader program, v5 will contain the input buffer's 1st attribute.
 
=== GPUREG_VSH_ATTRIBUTES_PERMUTATION_HIGH ===
 
{| class="wikitable" border="1"
! Bits
! Description
|-
| 0-3
| unsigned, Index of vertex shader input register which the 9th attribute will be stored in.
|-
| 4-7
| unsigned, Index of vertex shader input register which the 10th attribute will be stored in.
|-
| 8-11
| unsigned, Index of vertex shader input register which the 11th attribute will be stored in.
|-
| 12-15
| unsigned, Index of vertex shader input register which the 12th attribute will be stored in.
|-
| 16-19
| unsigned, Index of vertex shader input register which the 13th attribute will be stored in.
|-
| 20-23
| unsigned, Index of vertex shader input register which the 14th attribute will be stored in.
|-
| 24-27
| unsigned, Index of vertex shader input register which the 15th attribute will be stored in.
|-
| 28-31
| unsigned, Index of vertex shader input register which the 16th attribute will be stored in.
|}
 
This register sets the vertex shader input register index which will correspond to each attribute contained by the input buffer for attributes 8 through 15.
For example, having bits 0-3 set to 5 means that, in the vertex shader program, v5 will contain the input buffer's 9th attribute.
 
=== GPUREG_VSH_OUTMAP_MASK ===
 
{| class="wikitable" border="1"
! Bits
! Description
|-
| 0
| unsigned, Enable bit for vertex shader's o0 output register. (1 = o0 enabled, 0 = o0 disabled)
|-
| 1
| unsigned, Enable bit for vertex shader's o1 output register. (1 = o1 enabled, 0 = o1 disabled)
|-
| 2
| unsigned, Enable bit for vertex shader's o2 output register. (1 = o2 enabled, 0 = o2 disabled)
|-
| 3
| unsigned, Enable bit for vertex shader's o3 output register. (1 = o3 enabled, 0 = o3 disabled)
|-
| 4
| unsigned, Enable bit for vertex shader's o4 output register. (1 = o4 enabled, 0 = o4 disabled)
|-
| 5
| unsigned, Enable bit for vertex shader's o5 output register. (1 = o5 enabled, 0 = o5 disabled)
|-
| 6
| unsigned, Enable bit for vertex shader's o6 output register. (1 = o6 enabled, 0 = o6 disabled)
|-
| 7
| unsigned, Enable bit for vertex shader's o7 output register. (1 = o7 enabled, 0 = o7 disabled)
|-
| 8
| unsigned, Enable bit for vertex shader's o8 output register. (1 = o8 enabled, 0 = o8 disabled)
|-
| 9
| unsigned, Enable bit for vertex shader's o9 output register. (1 = o9 enabled, 0 = o9 disabled)
|-
| 10
| unsigned, Enable bit for vertex shader's o10 output register. (1 = o10 enabled, 0 = o10 disabled)
|-
| 11
| unsigned, Enable bit for vertex shader's o11 output register. (1 = o11 enabled, 0 = o11 disabled)
|-
| 12
| unsigned, Enable bit for vertex shader's o12 output register. (1 = o12 enabled, 0 = o12 disabled)
|-
| 13
| unsigned, Enable bit for vertex shader's o13 output register. (1 = o13 enabled, 0 = o13 disabled)
|-
| 14
| unsigned, Enable bit for vertex shader's o14 output register. (1 = o14 enabled, 0 = o14 disabled)
|-
| 15
| unsigned, Enable bit for vertex shader's o15 output register. (1 = o15 enabled, 0 = o15 disabled)
|}
 
This register toggles the vertex shader units' output registers.
 
=== GPUREG_VSH_CODETRANSFER_END ===
 
{| class="wikitable" border="1"
! Bits
! Description
|-
| 0
| unsigned, Code data transfer end signal bit.
|}
 
This register's value should be set to 1 in order to finalize the transfer of vertex shader code. It is unknown whether this register is used for other functions.
 
=== GPUREG_VSH_FLOATUNIFORM_CONFIG ===
 
{| class="wikitable" border="1"
! Bits
! Description
|-
| 0-6
| unsigned, Target float vec4 vertex shader uniform ID for transfer. (range 0-95, where 0 = c0 and 95 = c95)
|-
| 31
| unsigned, Float vec4 vertex shader uniform data transfer mode. (0 = float24, 1 = float32)
|}
 
This register sets the target float vec4 vertex shader uniform ID and transfer mode for the data transfer system. As such it is typically used right before [[#GPUREG_VSH_FLOATUNIFORM_DATA|GPUREG_VSH_FLOATUNIFORM_DATA]], though writing to one register does not make writing to the other mandatory.
 
=== GPUREG_VSH_FLOATUNIFORM_DATA ===
 
{| class="wikitable" border="1"
! Bits
! Description
|-
| 0-31
| Float vec4 vertex shader uniform data. (format depends on transfer mode, see below for details)
|}
 
This register is used to set the value of float vec4 vertex shader uniform registers. The data format which should be written to it depends on the transfer mode set with [[#GPUREG_VSH_FLOATUNIFORM_CONFIG|GPUREG_VSH_FLOATUNIFORM_CONFIG]]. This register functions as a FIFO queue : after each time a uniform register is successfully set, the target uniform ID value is incremented, meaning that groups of uniforms with contiguous register IDs can be set with only one initial write to [[#GPUREG_VSH_FLOATUNIFORM_CONFIG|GPUREG_VSH_FLOATUNIFORM_CONFIG]].
 
* In the case of float24 transfer mode, data should be sent by writing three words which are the concatenation of the float24 value of the uniform register's 4 components, in the reverse order. Assuming each letter corresponds to 4 bits, the format becomes :
** first word : ZZWWWWWW
** second word : YYYYZZZZ
** third word : XXXXXXYY
* In the case of float32 transfer mode, data should be sent by writing four words which are each the float32 value of the uniform register's 4 components, in the reverse order.
 
=== GPUREG_VSH_CODETRANSFER_CONFIG ===
 
{| class="wikitable" border="1"
! Bits
! Description
|-
| 0-11
| unsigned, Target vertex shader code offset for data transfer.
|}
 
This register is used to set the offset at which upcoming vertex shader code data transferred through [[#GPUREG_VSH_CODETRANSFER_DATA|GPUREG_VSH_CODETRANSFER_DATA]] should be written.
 
NOTE : as we do not yet know what a shader program's maximum size is yet, we also do not know how many bits the code offset parameter holds. The biggest shader binary observed so far was 2422 instructions long. The [[Shader_Instruction_Set#Instruction_formats|shader control flow instructions]] only have room to address 12 bits though, so it's likely that the maximum is 4095.
 
=== GPUREG_VSH_CODETRANSFER_DATA ===
 
{| class="wikitable" border="1"
! Bits
! Description
|-
| 0-31
| unsigned, Vertex shader instruction data.
|}
 
This register is used to transfer vertex shader code data. This register behaves as a FIFO queue : each write to this register writes the provided value to the GPU vertex shader code memory bank at the offset initially set by [[#GPUREG_VSH_CODETRANSFER_CONFIG|GPUREG_VSH_CODETRANSFER_CONFIG]]. The offset in question is incremented after each write to this register.
 
=== GPUREG_VSH_OPDESCS_CONFIG ===
 
{| class="wikitable" border="1"
! Bits
! Description
|-
| 0-6
| unsigned, Target vertex shader operand descriptor offset for data transfer.
|}
 
This register is used to set the offset at which upcoming vertex shader operand descriptor data transferred through [[#GPUREG_VSH_OPDESCS_DATA|GPUREG_VSH_OPDESCS_DATA]] should be written.
 
=== GPUREG_VSH_OPDESCS_DATA ===
 
{| class="wikitable" border="1"
! Bits
! Description
|-
| 0-31
| Vertex shader operand descriptor data.
|}
 
This register is used to transfer vertex shader operand descriptor data. This register behaves as a FIFO queue : each write to this register writes the provided value to the GPU vertex shader operand descriptor memory bank at the offset initially set by [[#GPUREG_VSH_OPDESCS_CONFIG|GPUREG_VSH_OPDESCS_CONFIG]]. The offset in question is incremented after each write to this register.
 
[[Category:GPU]]
1,291

edits

Navigation menu