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
17
18<h2>Description</h2>
19
20<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>
21
22<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>
23
24<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>
25
26<p>The combination of TMEM configuration and algorithms can be selected using the L and R buttons.</p>
27
28<h2>Coverage</h2>
29<TABLE border="1" cellpadding="3" cellspacing="0.1" width="640">
30  <tr>
31<TD width="30%" bgcolor="#C0C0C0"><EM><STRONG>Functions</STRONG></EM></TD>
32<TD width="25%" bgcolor="#C0C0C0"><EM><STRONG>Parameters</STRONG></EM></TD>
33<TD width="45%" bgcolor="#C0C0C0"><EM><STRONG>Description</STRONG></EM></TD>
34    </tr>
35  <tr>
36<TD width="30%" rowspan="5"><a href="../../../gx/Texture/GXInitTexObj.html"><code>GXInitTexObj</code></a></TD>
37<TD width="25%">Pointer to image data.</TD>
38<TD width="45%">Appropriate value.</TD>
39    </tr>
40  <tr>
41<TD width="25%">Width  and height</TD>
42<TD width="45%">Fixed.</TD>
43    </tr>
44  <tr>
45<TD width="25%">Format</TD>
46<TD width="45%">Always <FONT face="Courier New">GX_RGB565</FONT>.</TD>
47    </tr>
48  <tr>
49<TD width="25%">Wrap mode (s, t)</TD>
50<TD width="45%">Always <code>GX_REPEAT</code>.</TD>
51    </tr>
52  <tr>
53<TD width="25%">Mipmap</TD>
54<TD width="45%">Always <FONT face="Courier New">GX_TRUE</FONT>.</TD>
55    </tr>
56  <tr>
57<TD width="30%"><a href="../../../gx/Texture/GXInitTexObjUserData.html"><code>GXInitTexObjUserData</code></a></TD>
58<TD width="25%">User data pointer.</TD>
59<TD width="45%"><strong>Integer ID numbers</strong></TD>
60    </tr>
61  <tr>
62<TD width="30%"><a href="../../../gx/Texture/GXGetTexObjUserData.html"><code>GXGetTexObjUserData</code></a></TD>
63<TD width="25%">(No parameter)</TD>
64      <TD width="45%"></TD>
65    </tr>
66  <tr>
67<TD width="30%"><a href="../../../gx/Texture/GXLoadTexObj.html"><code>GXLoadTexObj</code></a></TD>
68<TD width="25%">Destination texture name</TD>
69<TD width="45%">Always <CODE>GX_TEXMAP0</CODE>.</TD>
70    </tr>
71  <tr>
72<TD width="30%" rowspan="3"><a href="../../../gx/Texture/GXInitTexCacheRegion.html"><code>GXInitTexCacheRegion</code></a></TD>
73<TD width="25%">32-bit mipmap flag.</TD>
74<TD width="45%">Always <CODE>GX_FALSE</CODE>.</TD>
75    </tr>
76  <tr>
77<TD width="25%">TMEM address (even, odd).</TD>
78<TD width="45%"><strong>Appropriate lower bank address (even).<br>Appropriate higher bank address (odd).</strong></TD>
79    </tr>
80  <tr>
81<TD width="25%">Cache size (even, odd).</TD>
82<TD width="45%"><strong>GX_TEXCACHE_32K</strong>,<strong> GX_TEXCACHE_128K</strong>,<strong>GX_TEXCACHE_512K</strong><br> Same value set for even and odd numbers.</TD>
83    </tr>
84  <tr>
85<TD width="30%"><a href="../../../gx/Texture/GXSetTexRegionCallback.html"><code>GXSetTexRegionCallBack</code></a></TD>
86<TD width="25%">Callback Functions</TD>
87<TD width="45%"><strong>Existing Functions</strong></TD>
88    </tr>
89  <tr>
90<TD width="30%"><a href="../../../gx/Texture/GXInvalidateTexAll.html"><code>GXInvalidateTexAll</code></a></TD>
91<TD width="25%">(No parameter)</TD>
92      <TD width="45%"></TD>
93    </tr>
94  <tr>
95<TD width="30%"><a href="../../../gx/Management/GXTexModeSync.html"><code>GXTexModeSync</code></a></TD>
96<TD width="25%">(No parameter)</TD>
97      <TD width="45%"></TD>
98    </tr>
99  <tr>
100<TD width="30%" rowspan="2"><a href="../../../gx/Tev/GXSetTevOp.html"><code>GXSetTevOp</code></a></TD>
101<TD width="25%">TEV stage ID</TD>
102<TD width="45%">Always <FONT face="Courier New">GX_TEVSTAGE0</FONT>.</TD>
103    </tr>
104  <tr>
105<TD width="25%">Operation mode</TD>
106<TD width="45%">always <CODE>GX_REPLACE</CODE></TD>
107    </tr>
108</TABLE>
109<h2>Operation Method</h2>
110
111<p>START exits the demo.</p>
112
113<p>The Controllser Stick scrolls the screen.</p>
114
115<p>The L and R Buttons toggle the TMEM map mode and callback algorithm.</p>
116
117<p>The X and Y Buttons change the number of quads to draw.</p>
118
119<p>B Button changes the seed value for generating random numbers.</p>
120
121<p></p>
122
123<h2>Snap Shots</h2>
124
125<p>8 x 32-KB regions, algorithm 0.</p>
126
127<P><IMG src="./images/tex-tc-alloc-0.gif" alt="tex-tc-alloc-0.gif (65589 bytes)" WIDTH="640" HEIGHT="480"></p>
128
129<p>8 x 32-KB regions, algorithm 1.</p>
130
131<P><IMG src="./images/tex-tc-alloc-1.gif" alt="tex-tc-alloc-1.gif (69301 bytes)" WIDTH="640" HEIGHT="480"></p>
132
133<p>8 x 32-KB regions, algorithm 2.</p>
134
135<P><IMG src="./images/tex-tc-alloc-2.gif" alt="tex-tc-alloc-2.gif (65942 bytes)" WIDTH="640" HEIGHT="480"></p>
136
137<p>4 x 128-KB regions, algorithm 0.</p>
138
139<P><IMG src="./images/tex-tc-alloc-3.gif" alt="tex-tc-alloc-3.gif (39186 bytes)" WIDTH="640" HEIGHT="480"></p>
140
141<p>1 x 512-KB region.</p>
142<P><IMG src="./images/tex-tc-alloc-6.gif" alt="tex-tc-alloc-6.gif (13546 bytes)" WIDTH="640" HEIGHT="480"></P>
143<h2>Data Files Required</h2>
144
145<p><FONT face="Courier New">$REVOLUTION_SDK_ROOT/dvddata/gxTests/tex-07.tpl</FONT></p>
146<H2>Revision History</H2>
147<P>03/01/2006 Initial version.</P>
148</body>
149</html>