Changes

No change in size ,  01:20, 16 December 2023
m
Fix lin to GPUREG_FIXEDATTRIB_DATA
Line 15: Line 15:  
Instead of using vertex arrays to supply vertex data, drawing can be done by directly writing vertex data to a register. This allows vertex data to be inlined directly in the command buffer. Since this is restricted to 4-component float data, it is more useful for small draws like UI elements or debug displays, to avoid using an unreasonable amount of memory and processing time appending the vertices to the command buffer.
 
Instead of using vertex arrays to supply vertex data, drawing can be done by directly writing vertex data to a register. This allows vertex data to be inlined directly in the command buffer. Since this is restricted to 4-component float data, it is more useful for small draws like UI elements or debug displays, to avoid using an unreasonable amount of memory and processing time appending the vertices to the command buffer.
   −
To use this feature, configure the number of attributes per vertex in [[GPU/Internal Registers#GPUREG_VSH_NUM_ATTR|GPUREG_VSH_NUM_ATTR]]. (All settings in the registers related to the vertex loader are ignored.) Then setup the GPU and shaders the same as if doing a regular draw call with GPUREG_DRAWARRAYS or GPUREG_DRAWELEMENTS, but instead of writing to either register, write the value 0xF to [[GPU/Internal Registers#GPUREG_FIXEDATTRIB_INDEX|GPUREG_FIXEDATTRIB_INDEX]] and then follow by repeatedly writing vertex data to [[GPU/Internal Registers#GPUREG_FIXEDATTRIB_DATA0|GPUREG_FIXEDATTRIB_DATA]].
+
To use this feature, configure the number of attributes per vertex in [[GPU/Internal Registers#GPUREG_VSH_NUM_ATTR|GPUREG_VSH_NUM_ATTR]]. (All settings in the registers related to the vertex loader are ignored.) Then setup the GPU and shaders the same as if doing a regular draw call with GPUREG_DRAWARRAYS or GPUREG_DRAWELEMENTS, but instead of writing to either register, write the value 0xF to [[GPU/Internal Registers#GPUREG_FIXEDATTRIB_INDEX|GPUREG_FIXEDATTRIB_INDEX]] and then follow by repeatedly writing vertex data to [[GPU/Internal Registers#GPUREG_FIXEDATTRIB_DATAi|GPUREG_FIXEDATTRIB_DATA]].
    
Each set of writes to the 3 data registers specifies one attribute and all attributes (as configured in GPUREG_VSH_NUM_ATTR) need to be written, in order, to specify a vertex. Drawing happens automatically as vertices are specified. After finishing specifying vertices, follow with the same writes used after a draw arrays/elements.
 
Each set of writes to the 3 data registers specifies one attribute and all attributes (as configured in GPUREG_VSH_NUM_ATTR) need to be written, in order, to specify a vertex. Drawing happens automatically as vertices are specified. After finishing specifying vertices, follow with the same writes used after a draw arrays/elements.
33

edits