GXSetDrawSync

Syntax

#include <revolution/gx.h>

void GXSetDrawSync( u16 token );

Arguments

token A 16-bit value for writing to the token register.

Return Values

None.

Description

This function sends a token into the command stream. When the token reaches the end of the graphics pipeline (just before the frame buffer), it is written to a special token register. You can read out this register using the GXReadDrawSync function. This allows the application to monitor the completion of graphics rendering tasks.

When the token register is set, an interrupt is also received by the CPU. Install a callback on this interrupt with GXSetDrawSyncCallback. This will allow you to sample performance counters to profile the elapsed time between events in the graphics pipeline. Rendering synchronization can also be used to notify the CPU that the graphics processor is finished using a shared resource (a vertex array, for example). The GXSetDrawSync function calls the GXFlush function. Therefore, there is no need to explicitly call the GXFlush function after you have set the token with GXSetDrawSync.

See Also

GXReadDrawSync, GXSetDrawSyncCallback

Revision History

2008/05/12 Mentioned that GXFlush is included.
2006/03/01 Initial version.


CONFIDENTIAL