1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 6.5.0.0 for Windows"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<LINK rel="stylesheet" type="text/css" href="../../../CSS/revolution.css"> 9<title>perf-sync</title> 10</head> 11 12<body> 13 14<h1 align="left">perf-sync</h1> 15 16 17 18<h2>Description</h2> 19<P><code>perf-sync</code> 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 <code><a href="../../Management/GXDrawDone.html">GXDrawDone</a></code> to discern the timing.</P> 20<P>If your target contains some objects, and if you want to measure performance for each object, using a draw-sync callback (i.e. <code><a href="../../Management/GXSetDrawSyncCallback.html">GXSetDrawSyncCallback</a></code>) 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.</P> 21<h2>Coverage</h2> 22<TABLE border="1" cellpadding="3" cellspacing="0.1" width="640"> 23 <tr> 24<TD width="30%" bgcolor="#C0C0C0"><em><strong>Functions</strong></em></TD> 25<TD width="25%" bgcolor="#C0C0C0"><em><strong>Parameters</strong></em></TD> 26<TD width="45%" bgcolor="#C0C0C0"><em><strong>Description</strong></em></TD> 27 </tr> 28 <tr> 29<TD width="30%"><a href="../../../gx/Performance/GXSetGPMetric.html"><code>GXSetGP0Metric</code></a></TD> 30<TD width="25%"><em><strong><code>perf0</code></strong></em></TD> 31<TD width="45%"><FONT face="Courier New">GX_PERF0_CLOCKS</FONT></TD> 32 </tr> 33 <tr> 34<TD width="30%"><a href="../../../gx/Performance/GXReadGP0Metric.html"><code>GXReadGP0Metric</code></a></TD> 35<TD width="25%">(No parameter)</TD> 36 <TD width="45%"> </TD> 37 </tr> 38 <tr> 39<TD width="30%"><a href="../../../gx/Management/GXSetDrawSyncCallback.html"><code>GXSetDrawSyncCallback</code></a></TD> 40<TD width="25%"><em><strong><code>cb</code></strong></em></TD> 41<TD width="45%">User callback</TD> 42 </tr> 43</TABLE> 44<h2>Operation Method</h2> 45<P>A Button — Prints performance information (number of clocks per object) onto the debug console.</P> 46<h2>Required Data Files</h2> 47<P>None.</P> 48<H2>Revision History</H2> 49<P>03/01/2006 Initial version.</P> 50</body> 51</html> 52