#include <revolution/gx.h> void GXSetGPFifo( const GXFifoObj* fifo );
| fifo | A pointer to the FIFO structure. |
|---|
None.
This function attaches a FIFO to the GP. The GP calls commands from the FIFO and executes them sequentially. If the same FIFO is connected to the CPU using the GXSetCPUFifo function, the FIFO will be an immediate mode interface used for rendering graphics. Conversely, separating the FIFO used to connect to the CPU from the FIFO used to connect to the GP allows a frame's worth of graphics commands to be accumulated for use.
The GXInit function initializes the default FIFO and sets it up as an immediate mode graphics interface.
The fifo structure must be initialized, using the GXInitFifoBase, GXInitFifoLimits and GXInitFifoPtrs functions, before calling the GXSetGPFifo function. After configuring by calling GXSetGPFifo, there is no need to keep the contents of the fifo structure.
The FIFO region must be allocated in internal memory (MEM1 region) of the system. Note: The external memory (MEM2 region) cannot be allocated.
When a FIFO is attached to both the CPU and GP, the FIFO acts as a true FIFO buffer. In this mode, the high and low watermarks function and flow control is enabled between the CPU and GP. The CPU stops writing graphics commands to the FIFO if the volume of commands accumulating in the FIFO exceeds the high water mark. The CPU resumes sending graphics commands to the FIFO after the GP catches up and the volume of commands accumulating in the FIFO falls below the low watermark. These watermark settings can be established using the GXInitFifoLimits function. The high watermark is set to [(FIFO size) - GX_FIFO_HI_WATERMARK_BUFFER] at the point in the process where the FIFO structure is initialized using the GXInitFifoBase function. GX_FIFO_HI_WATERMARK_BUFFER is defined as 16KB. The low watermark is set to be half of the FIFO size.
The FIFO functions as a fixed command list when it is connected only to the GP. If a FIFO containing commands is connected to the GP, it will be read until empty. Before attaching a new FIFO to the GP, you should make sure the previous FIFO is empty, using the cmdIdle status returned by the GXGetGPStatus function.
2006/03/01 Initial version.
CONFIDENTIAL