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="Microsoft FrontPage 5.0"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 9<title>GXReadPixMetric</title> 10</head> 11 12<body> 13 14<h1 align="left">GXReadPixMetric</h1> 15 16 17<h2>C Specification</h2> 18 19<dl> 20<dd><PRE><CODE>#include <revolution/gx.h></CODE></PRE> 21 </dd> 22<dd><pre><CODE>void GXReadPixMetric( u32* top_pixels_in, 23u32* top_pixels_out, 24u32* bot_pixels_in, 25u32* bot_pixels_out, 26u32* clr_pixels_in, 27u32* copy_clks );</CODE></pre> 28 </dd> 29</dl> 30 31<h2>Arguments</h2> 32<TABLE border="1" cellpadding="3" cellspacing="0.1"> 33 <tr> 34<TD width="120" bgcolor="#ffffe8"><em><strong><CODE>top_pixels_in</font></strong></em></TD> 35<td width="78%">number of pixels input for Z comparison before texture lookup</td> 36 </tr> 37 <tr> 38<TD width="120" bgcolor="#ffffe8"><em><strong><CODE>top_pixels_out</font></strong></em></TD> 39<td width="78%">number of pixels passed to Z comparison before texture lookup</td> 40 </tr> 41 <tr> 42<TD width="120" bgcolor="#ffffe8"><em><strong><CODE>bot_pixels_in</font></strong></em></TD> 43<td width="78%">number of pixels input for Z comparison after texture lookup</td> 44 </tr> 45 <tr> 46<TD width="120" bgcolor="#ffffe8"><em><strong><CODE>bot_pixels_out</font></strong></em></TD> 47<td width="78%">number of pixels passed to Z comparison after texture lookup</td> 48 </tr> 49 <tr> 50<TD width="120" bgcolor="#ffffe8"><em><strong><CODE>clr_pixels_in</font></strong></em></TD> 51<td width="78%">number of pixels input for the blender</td> 52 </tr> 53 <tr> 54<TD width="120" bgcolor="#ffffe8"><em><strong><CODE>copy_clks</font></strong></em></TD> 55<td width="78%">number of GP clock cycles consumed in copying to the texture or display buffer</td> 56 </tr> 57</TABLE> 58<h2>Return Values</h2> 59 60<p>None.</p> 61<H2>Description</H2> 62<P>The graphics processor (GP) can count many internal events that give detailed information on performance. This function returns the number of pixels processed in the GP pipeline and the number of clocks spent copying the embedded frame buffer (EFB) to textures or external frame buffer (XFB).</P> 63<P>Call <a href="GXClearPixMetric.html"><code>GXClearPixMetric</code></a> to reset the counters to zero.</P> 64<H3>Example</H3> 65<P><code>u32 tpi, tpo, bpi, bpo, cpi, cc;<br> <br> GXClearPixMetric();<br> <br> // Draw Object(s)</code></P> 66<P><CODE>// wait until object drawn<BR> GXSetDrawSync(0xbeef);<BR> while (0xbeef != GXReadDrawSync())<BR> ;<BR> <BR> GXReadPixMetric(&tpi, &tpo, &bpi, &bpo, &cpi, &cc); // returns request counter<BR> <BR> OSReport("Number of copy clocks: %d\n",cc);</CODE></P> 67<P>This function reads CPU-accessible registers in the GP and so should not be called in a display list.</P> 68<H3>Pixel Counter Details</H3> 69<P>The GP can be configured for Z buffering before or after texture lookup (see <a href="../PixelProc/GXSetZCompLoc.html"><code>GXSetZCompLoc</code></a>). The argument <code>top_pixels_in</code> returns the number of pixels entering the Z compare before texture lookup. The argument <code>top_pixels_out</code> indicates how many pixels passed the Z comparison test. </P> 70<P>The argument <code>bot_pixels_in</code> counts the number of pixels input to Z comparison after texture lookup. The argument <code>bot_pixels_out</code> indicates how many pixels passed Z comparison.</P> 71<P>The argument <code>clr_pixels_in</code> counts the number of pixels processed by the blend unit in the last stage of the pipeline. This is normally the sum of <CODE>top_pixels_out</CODE> and <CODE>bot_pixels_out</CODE>.</P> 72<P>The argument <code>copy_clks</code> counts the number of GP clock cycles spent on copy operations, either from the EFB to a texture (see <a href="../Framebuffer/GXCopyTex.html"><code>GXCopyTex</code></a>), or from the EFB to a display buffer (see <a href="../Framebuffer/GXCopyDisp.html"><code>GXCopyDisp</code></a>).</P> 73<P>Note that the hardware can only count the number of quads (2x2 pixel blocks) instead of pixels. Since each counter value is calculated as 4x of the number of quads that passed specified event, it is not accurate in pixels and usually over-counted.</P> 74 75 76 77 78<h2>See Also</h2> 79 80<p><a href="GXReadMemMetric.html"><CODE>GXReadMemMetric</CODE></a><br> <a href="GXClearMemMetric.html"><CODE>GXClearMemMetric</CODE></a><br> <a href="GXSetVCacheMetric.html"><CODE>GXSetVCacheMetric</CODE></a><br> <a href="GXReadVCacheMetric.html"><CODE>GXReadVCacheMetric</CODE></a><br> <a href="GXClearVCacheMetric.html"><CODE>GXClearVCacheMetric</CODE></a><br> <a href="GXReadGPMetric.html"><CODE>GXReadGPMetric</CODE></a><br> <a href="GXSetGPMetric.html"><CODE>GXSetGPMetric</CODE></a><br> <a href="GXClearGPMetric.html"><CODE>GXClearGPMetric</CODE></a></p> 81<H2>Revision History</H2> 82<P>03/01/2006 Initial version.</P>