perf-sync shows a simple method to measure drawing performance per model included in an entire frame that consists of many models. To measure performance for drawing a target, first you should know when the GP starts/finishes drawing the target. Since the CPU and GP are processing data asynchronously, you should use a synchronization mechanism like GXDrawDone to discern the timing.
If your target contains some objects, and if you want to measure performance for each object, using a draw-sync callback (i.e. GXSetDrawSyncCallback) is a simple solution. This demo assigns a different token to each model, and detects the change of current token by using a draw-sync callback. The callback routine keeps track of current GP performance metric values, which is considered as lap-time per object. In this demo, it counts the number of GP clocks used to draw each object.
| Functions | Parameters | Description |
GXSetGP0Metric |
perf0 |
GX_PERF0_CLOCKS |
GXReadGP0Metric |
(No parameter) | |
GXSetDrawSyncCallback |
cb |
User callback |
A Button — Prints performance information (number of clocks per object) onto the debug console.
None.
03/01/2006 Initial version.