Difference between revisions of "GPU/Internal Registers"
(formatting) |
|||
Line 3,102: | Line 3,102: | ||
| | | | ||
|} | |} | ||
+ | |||
+ | === GPUREG_FINALIZE === | ||
+ | |||
+ | Writing to this register seems to signal the GPU to stop processing GPU commands from the current buffer; any command following a write to this register will be ignored. The value written to this register does not appear to matter, although 0x12345678 is the value typically written by commercial software. | ||
+ | Failure to write to this register in any command buffer will result in the GPU hanging. | ||
=== GPUREG_GEOSTAGE_CONFIG === | === GPUREG_GEOSTAGE_CONFIG === | ||
Line 3,124: | Line 3,129: | ||
This register configures the geometry stage of the GPU pipeline. | This register configures the geometry stage of the GPU pipeline. | ||
− | === GPUREG_GSH_ENTRYPOINT === | + | === Geometry shader registers === |
+ | |||
+ | ==== GPUREG_GSH_ENTRYPOINT ==== | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 3,139: | Line 3,146: | ||
This sets the entrypoint for the program running on the single shader unit which can be dedicated to running geometry shaders, regardless of the current geometry stage mode. This is means that while this register is normally used to set the geometry shader entrypoint, it can also be used to set this single shader unit to run from a different entrypoint than the other three even when running a vertex shader. | This sets the entrypoint for the program running on the single shader unit which can be dedicated to running geometry shaders, regardless of the current geometry stage mode. This is means that while this register is normally used to set the geometry shader entrypoint, it can also be used to set this single shader unit to run from a different entrypoint than the other three even when running a vertex shader. | ||
+ | === Vertex shader registers === | ||
− | === GPUREG_VSH_ENTRYPOINT === | + | ==== GPUREG_VSH_ENTRYPOINT ==== |
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 3,154: | Line 3,162: | ||
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. | 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. | ||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 07:29, 16 December 2014
(this page is hugely WIP)
Overview
GPU internal registers are written to through GPU commands. They are used to control the GPU's behavior, that is to say tell it to draw stuff and how we want it drawn.
Types
There are three main types of registers :
- configuration registers, which directly map to various rendering properties (for example : GPUREG_FACECULLING_CONFIG)
- data transfer registers, which can be seen as FIFOs that let us send sequential chunks of data to the GPU, such as shader code or 1D samplers (for example : GPUREG_GSH_CODE_DATA)
- action triggering registers, which tell the GPU to do something, like draw a primitive (for example : GPUREG_DRAWARRAYS)
Aliases
It is possible for multiple register (sequential) IDs to correspond to the same register. This is done to leverage the consecutive writing mode for GPU Commands, which makes it possible for a single command to write data to multiple sequential register IDs. For example, register IDs 02C1 through 02C8 all correspond to GPUREG_VSH_FLOATUNIFORM_DATA so that a consecutively writing command based at 02C0 will write its first parameter to GPUREG_VSH_FLOATUNIFORM_CONFIG and ever subsequent ones to GPUREG_VSH_FLOATUNIFORM_DATA
Register list
GPUREG_FINALIZE
Writing to this register seems to signal the GPU to stop processing GPU commands from the current buffer; any command following a write to this register will be ignored. The value written to this register does not appear to matter, although 0x12345678 is the value typically written by commercial software. Failure to write to this register in any command buffer will result in the GPU hanging.
GPUREG_GEOSTAGE_CONFIG
Bits | Description |
---|---|
0-7 | Geometry stage mode. (0=Vertex shader only, 2=Vertex shader + geometry shader) |
0-7 | Unknown. Often set to 1. |
0-7 | Unknown. |
0-7 | Unknown. Often set to 0. |
This register configures the geometry stage of the GPU pipeline.
Geometry shader registers
GPUREG_GSH_ENTRYPOINT
Bits | Description |
---|---|
0-15 | Geometry shader unit 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 the single shader unit which can be dedicated to running geometry shaders, regardless of the current geometry stage mode. This is means that while this register is normally used to set the geometry shader entrypoint, it can also be used to set this single shader unit to run from a different entrypoint than the other three even when running a vertex shader.
Vertex shader registers
GPUREG_VSH_ENTRYPOINT
Bits | Description |
---|---|
0-15 | 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.