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<h2>Syntax</h2> 17<dl><dd><pre class="construction"> 18#include <revolution/gx.h> 19 20void GXReadPixMetric( u32* top_pixels_in, 21 u32* top_pixels_out, 22 u32* bot_pixels_in, 23 u32* bot_pixels_out, 24 u32* clr_pixels_in, 25 u32* copy_clks ); 26</pre></dd></dl> 27 28<h2>Arguments</h2> 29<TABLE class="arguments" border="1" > 30 <tr> 31<TH>top_pixels_in</TH> 32<td>The number of pixels input for Z comparison before the texture lookup.</td> 33 </tr> 34 <tr> 35<TH>top_pixels_out</TH> 36<td>The number of pixels passed for Z comparison before the texture lookup.</td> 37 </tr> 38 <tr> 39<TH>bot_pixels_in</TH> 40<td>The number of pixels input for Z comparison after the texture lookup.</td> 41 </tr> 42 <tr> 43<TH>bot_pixels_out</TH> 44<td>The number of pixels passed for Z comparison after the texture lookup.</td> 45 </tr> 46 <tr> 47<TH>clr_pixels_in</TH> 48<td>The number of pixels input for the blender.</td> 49 </tr> 50 <tr> 51<TH>copy_clks</TH> 52<td>The number of GP clock cycles consumed in copying to the texture or display buffer.</td> 53 </tr> 54</TABLE> 55 56<h2>Return Values</h2> 57<p>None.</p> 58 59<H2>Description</H2> 60<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 clock cycles spent copying the embedded frame buffer (EFB) to textures or external frame buffer (XFB).</P> 61<P>Call the <A href="GXClearPixMetric.html"><CODE>GXClearPixMetric</CODE></A> function to reset these counters to zero.</P> 62 63<H3>Example</H3> 64<DL><DD><CODE>u32 tpi, tpo, bpi bpo, cpi, cc;<BR> <BR> GXClearPixMetric();<BR> <BR> // Render Object(s)</CODE></DD></DL> 65<DL><DD><CODE>// wait until object(s) rendered<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></DD></DL> 66<P>This function reads CPU-accessible registers in the GP and so should not be called in a display list.</P> 67 68<H3>Pixel Counter Details</H3> 69<P>In the GP, the Z buffer can be constructed either before or after texture lookups (see the<A href="../PixelProc/GXSetZCompLoc.html"><CODE>GXSetZCompLoc</CODE></A> function). The <SPAN class="argument">top_pixels_in</SPAN> argument returns the number of pixels input to Z comparison before texture lookup. The <SPAN class="argument">top_pixels_out</SPAN> argument indicates how many pixels passed the Z comparison test. </P> 70<P>The <SPAN class="argument">bot_pixels_in</SPAN> argument counts the number of pixels input to Z comparison after texture lookup. The <SPAN class="argument">bot_pixels_out</SPAN> argument indicates how many pixels passed Z comparison.</P> 71<P>The <SPAN class="argument">clr_pixels_in</SPAN> argument counts the number of pixels processed by the blend unit in the last stage of the pipeline.<BR>This is normally the sum of <SPAN class="argument">top_pixels_out</SPAN> and <SPAN class="argument">bot_pixels_out</SPAN>.</P> 72<P>The <SPAN class="argument">copy_clks</SPAN> argument counts the number of GP clock cycles spent on copy operations, either from the EFB to a texture (see the<A href="../Framebuffer/GXCopyTex.html"><CODE>GXCopyTex</CODE></A> function), or from the EFB to a display buffer (see the <A href="../Framebuffer/GXCopyDisp.html"><CODE>GXCopyDisp</CODE></A> function).</P> 73<P>Note that the hardware can only count the number of quads (2x2 pixel blocks) instead of pixels. Each counter value is calculated as 4x of the number of quads that passed the specified event, it is not accurate in pixels and usually over-counted.</P> 74 75<h2>See Also</h2> 76<P class="reference"> 77<a href="GXReadMemMetric.html">GXReadMemMetric</a>, 78<a href="GXClearMemMetric.html">GXClearMemMetric</a>, 79<a href="GXSetVCacheMetric.html">GXSetVCacheMetric</a>, 80<a href="GXReadVCacheMetric.html">GXReadVCacheMetric</a>, 81<a href="GXClearVCacheMetric.html">GXClearVCacheMetric</a>, 82<a href="GXReadGPMetric.html">GXReadGPMetric</a>, 83<a href="GXSetGPMetric.html">GXSetGPMetric</a>, 84<a href="GXClearGPMetric.html">GXClearGPMetric</a> 85</p> 86 87<H2>Revision History</H2> 88<P> 892006/03/01 Initial version.<br> 90</P> 91 92<hr><p>CONFIDENTIAL</p></body> 93</html>