Changes

Jump to navigation Jump to search
display list stuff
The GU routines use hardware to perform drawing operations for you. Note that you can draw to different locations, such as a memory buffer or to the framebuffer, in the latter case you'll see the result on screen. This also means it is possible to combine page flipping with hardware assisted drawing, and there's GU routines to help with this. It is important to note that since the GPU is drawing stuff the CPU are free to do other things, also note that you have to consider that the CPU doesn't know what the GPU is doing and vice versa. Because of cache, all textures, vertex lists and such must be in memory before you use them. This means you use a function to invalidate the cache for those memory regions causing any cached data to be written to memory. Again the same data also needs to be in a memory address that is a multiple of 16 bytes, but if you use GU routines to allocate the memory they will take care of this for you. Textures need to be swizzled as well.
 
=== Display Lists ===
Drawing graphics can be done by hitting VRAM directly, for decent performance and 3D work you need to use the display lists.
* Each entry in the display list is 32-bits wide: 8-bits command, 24-bits data
* 24bit data can represent an integer, a pointer or a cut down float
* Can create sub-lists and which are called from your main list
* Can specify custom vertex types, different size (8/16-bit fixed point, 32-bit float)
* Each vertex type can include, position, colour, normal or weight
* Vertices can be specified as a direct list or indexed
* Due to floats only being 24bit precision can be lost during transformation stage
 
The display lists are transferred to the GE using a DMA mechanism, this has important ramifications when developing the lists.
* A list can be transferred while building it using a 'Stall' address
* The list must be written using an uncached memory area or the datacache written back before use
* Lists should be terminated with a FINISH command
 
<syntaxhighlight lang="c">
uint32_t list [256∗1024]; //Define a display list
 
int qid = sceGeListEnQueue(list, list, cbid, NULL);
/∗ Fill in the dispay list ∗/
sceKernelDcacheWritebackInvalidateAll(); //Writeback cache
sceGeListUpdateStallAddr(qid, &list[endp]);
</syntaxhighlight>
=== Developing VFPU Code ===

Navigation menu