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<h2>Description</h2> 17<P>This program shows a simple method to measure drawing performance per model included in an entire frame that consists of many models. To measure performance for rendering a target, first you should know when the graphics processor starts/finishes rendering the target. Since the CPU and GP are processing data asynchronously, you should use a synchronization mechanism like the <A href="../../../gx/Management/GXDrawDone.html"><code>GXDrawDone</code></A> function to discern the timing.</P> 18<P>If your target contains some objects, and if you want to measure performance for each object, using a draw-sync callback (<A href="../../../gx/Management/GXSetDrawSyncCallback.html"><code>GXSetDrawSyncCallback</code></A>) 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 render each object.</P> 19 20<h2>Coverage</h2> 21<TABLE border="1" cellpadding="3" cellspacing="0.1" width="640"> 22 <tr> 23 <TD width="30%" bgcolor="#C0C0C0"><em><strong>Functions</strong></em></TD> 24 <TD width="25%" bgcolor="#C0C0C0"><em><strong>Parameters</strong></em></TD> 25 <TD width="45%" bgcolor="#C0C0C0"><em><strong>Description</strong></em></TD> 26 </tr> 27 <tr> 28 <TD width="30%"><a href="../../../gx/Performance/GXSetGPMetric.html"><code>GXSetGP0Metric</code></a></TD> 29 <TD width="25%"><SPAN class="argument">perf0</SPAN></TD> 30 <TD width="45%"><CODE>GX_PERF0_CLOCKS</CODE></TD> 31 </tr> 32 <tr> 33 <TD width="30%"><a href="../../../gx/Performance/GXReadGP0Metric.html"><code>GXReadGP0Metric</code></a></TD> 34 <TD width="25%">(No parameter)</TD> 35 <TD width="45%"> </TD> 36 </tr> 37 <tr> 38 <TD width="30%"><a href="../../../gx/Management/GXSetDrawSyncCallback.html"><code>GXSetDrawSyncCallback</code></a></TD> 39 <TD width="25%"><SPAN class="argument">cb</SPAN></TD> 40 <TD width="45%">User callback.</TD> 41 </tr> 42</TABLE> 43 44<h2>Using the Demo</h2> 45<P>A Button — Outputs performance information (number of clocks per object) on the debug console.</P> 46 47<h2>Required Data Files</h2> 48<P>None.</P> 49 50<H2>Revision History</H2> 51<P> 522006/03/01 Initial version.<br> 53</P> 54 55<hr><p>CONFIDENTIAL</p></body> 56</html> 57