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>tex-tc-alloc</title> 10</head> 11 12<body> 13 14<h1 align="left">tex-tc-alloc</h1> 15 16<h2>Description</h2> 17<p>This program tests texture cache region control elements that include the initializer, allocator, and callback. All possible cache size settings and some callback examples can be tested. Hundreds of square panels are drawn in one frame, and a randomly chosen texture is mapped on each panel. This program shows how the cache region is used for drawing each texture panel.</p> 18 19<p>This program has three TMEM setting examples (8x32KB, 4x128KB, 1x512KB). In 8x32 KB and 4x128 KB mode, one of the three callback examples based on the following algorithms is used to decide which region should be allocated for a given texture.</p> 20 21<p>Algorithm 0 : allocates regions sequentially.<BR>Algorithm 1 : allocates regions according to predefined texture ID.<BR>Algorithm 2 : uses tags, and finds the region currently used by the same texture.</p> 22 23<p>The combination of TMEM configuration and algorithms can be selected using the L and R buttons.</p> 24 25<h2>Coverage</h2> 26<TABLE border="1" cellpadding="3" cellspacing="0.1" width="640"> 27 <tr> 28<TD width="30%" bgcolor="#C0C0C0"><EM><STRONG>Functions</STRONG></EM></TD> 29<TD width="25%" bgcolor="#C0C0C0"><EM><STRONG>Parameters</STRONG></EM></TD> 30<TD width="45%" bgcolor="#C0C0C0"><EM><STRONG>Description</STRONG></EM></TD> 31 </tr> 32 <tr> 33<TD width="30%" rowspan="5"><a href="../../../gx/Texture/GXInitTexObj.html"><code>GXInitTexObj</code></a></TD> 34<TD width="25%"><SPAN class="argument">Pointer to image data.</SPAN></TD> 35<TD width="45%">Appropriate value.</TD> 36 </tr> 37 <tr> 38<TD width="25%"><SPAN class="argument">Width and height</SPAN></TD> 39<TD width="45%">Fixed.</TD> 40 </tr> 41 <tr> 42<TD width="25%"><SPAN class="argument">format</SPAN></TD> 43<TD width="45%">Always <CODE>GX_RGB565</CODE>.</TD> 44 </tr> 45 <tr> 46<TD width="25%"><SPAN class="argument">Wrap mode (s, t).</SPAN></TD> 47<TD width="45%">Always <CODE>GX_REPEAT</CODE>.</TD> 48 </tr> 49 <tr> 50<TD width="25%"><SPAN class="argument">Mipmap</SPAN></TD> 51<TD width="45%">Always <CODE>GX_TRUE</CODE>.</TD> 52 </tr> 53 <tr> 54<TD width="30%"><a href="../../../gx/Texture/GXInitTexObjUserData.html"><code>GXInitTexObjUserData</code></a></TD> 55<TD width="25%"><SPAN class="argument">User data pointer</SPAN></TD> 56<TD width="45%"><strong>Integer ID numbers</strong></TD> 57 </tr> 58 <tr> 59<TD width="30%"><a href="../../../gx/Texture/GXGetTexObjUserData.html"><code>GXGetTexObjUserData</code></a></TD> 60<TD width="25%"><SPAN class="argument">(No parameter)</SPAN></TD> 61 <TD width="45%"> </TD> 62 </tr> 63 <tr> 64<TD width="30%"><a href="../../../gx/Texture/GXLoadTexObj.html"><code><CODE>GXLoadTexObj</CODE></code></a></TD> 65<TD width="25%"><SPAN class="argument">Destination texture name.</SPAN></TD> 66<TD width="45%">Always <CODE>GX_TEXMAP0</CODE>.</TD> 67 </tr> 68 <tr> 69<TD width="30%" rowspan="3"><a href="../../../gx/Texture/GXInitTexCacheRegion.html"><code>GXInitTexCacheRegion</code></a></TD> 70<TD width="25%"><SPAN class="argument">32-bit mipmap flag.</SPAN></TD> 71<TD width="45%">Always <CODE>GX_FALSE</CODE>.</TD> 72 </tr> 73 <tr> 74<TD width="25%"><SPAN class="argument">TMEM address (even, odd).</SPAN></TD> 75<TD width="45%"><strong>Appropriate lower bank address (even)<br> Appropriate higher bank address (odd)</strong></TD> 76 </tr> 77 <tr> 78<TD width="25%"><SPAN class="argument">Cache size (even, odd).</SPAN></TD> 79<TD width="45%"><strong><CODE>GX_TEXCACHE_32K</CODE></strong>, <strong><CODE>GX_TEXCACHE_128K</CODE></strong>, <strong><CODE>GX_TEXCACHE_512K</CODE></strong><br> Same value is set for both even and odd numbers.</TD> 80 </tr> 81 <tr> 82<TD width="30%"><a href="../../../gx/Texture/GXSetTexRegionCallback.html"><code>GXSetTexRegionCallBack</code></a></TD> 83<TD width="25%"><SPAN class="argument">Callback Functions</SPAN></TD> 84<TD width="45%"><strong>Existing Functions</strong></TD> 85 </tr> 86 <tr> 87<TD width="30%"><a href="../../../gx/Texture/GXInvalidateTexAll.html"><code>GXInvalidateTexAll</code></a></TD> 88<TD width="25%"><SPAN class="argument">(No parameter)</SPAN></TD> 89 <TD width="45%"> </TD> 90 </tr> 91 <tr> 92<TD width="30%"><a href="../../../gx/Management/GXTexModeSync.html"><code>GXTexModeSync</code></a></TD> 93<TD width="25%"><SPAN class="argument">(No parameter)</SPAN></TD> 94 <TD width="45%"> </TD> 95 </tr> 96 <tr> 97<TD width="30%" rowspan="2"><a href="../../../gx/Tev/GXSetTevOp.html"><code>GXSetTevOp</code></a></TD> 98<TD width="25%"><SPAN class="argument">TEV stage ID.</SPAN></TD> 99<TD width="45%">Always <CODE>GX_TEVSTAGE0</CODE>.</TD> 100 </tr> 101 <tr> 102<TD width="25%"><SPAN class="argument">Operation mode</SPAN></TD> 103<TD width="45%">Always <CODE>GX_REPLACE</CODE>.</TD> 104 </tr> 105</TABLE> 106 107<h2>Using the Demo</h2> 108<p>START exits the demo.</p> 109<p>The Controllser Stick scrolls the screen.</p> 110<p>The L and R Buttons toggle the TMEM map mode and callback algorithm.</p> 111<p>The X and Y Buttons change the number of quads to draw.</p> 112<p>B Button changes the seed value for generating random numbers.</p> 113 114<h2>Snap Shots</h2> 115<p>8 x 32-KB regions, algorithm 0.</p> 116<P><IMG src="./images/tex-tc-alloc-0.gif" alt="tex-tc-alloc-0.gif (65589 bytes)" WIDTH="640" HEIGHT="480"></p> 117 118<p>8 x 32-KB regions, algorithm 1.</p> 119<P><IMG src="./images/tex-tc-alloc-1.gif" alt="tex-tc-alloc-1.gif (69301 bytes)" WIDTH="640" HEIGHT="480"></p> 120 121<p>8 x 32-KB regions, algorithm 2.</p> 122<P><IMG src="./images/tex-tc-alloc-2.gif" alt="tex-tc-alloc-2.gif (65942 bytes)" WIDTH="640" HEIGHT="480"></p> 123 124<p>4 x 128-KB regions, algorithm 0.</p> 125<P><IMG src="./images/tex-tc-alloc-3.gif" alt="tex-tc-alloc-3.gif (39186 bytes)" WIDTH="640" HEIGHT="480"></p> 126 127<p>1 x 512-KB region.</p> 128<P><IMG src="./images/tex-tc-alloc-6.gif" alt="tex-tc-alloc-6.gif (13546 bytes)" WIDTH="640" HEIGHT="480"></P> 129 130<h2>Data Files Required</h2> 131<p><CODE>$REVOLUTION_SDK_ROOT/dvddata/gxTests/tex-07.tpl</CODE></p> 132 133<H2>Revision History</H2> 134<P> 1352006/03/01 Initial version.<br> 136</P> 137 138<hr><p>CONFIDENTIAL</p></body> 139</html>