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>GXInitTexPreLoadRegion</title>
10</head>
11
12<body>
13
14<h1 align="left">GXInitTexPreLoadRegion</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">
18#include &lt;revolution/gx.h&gt;
19
20void GXInitTexPreLoadRegion(
21    <a href="../Structures/GXTexRegion.html">GXTexRegion</a>*      region,
22    u32               tmem_even,
23    u32               size_even,
24    u32               tmem_odd,
25    u32               size_odd );
26</pre></dd></dl>
27
28<h2>Arguments</h2>
29<TABLE class="arguments" border="1" >
30  <tr>
31<TH>region</TH>
32<TD>Pointer to a <A href="../Structures/GXTexRegion.html"><CODE>GXTexRegion</CODE></A> structure</TD>
33  </tr>
34  <tr>
35<TH>tmem_even</TH>
36<TD>Base pointer to texture memory used for even-numbered LODs of the mipmap (see table below). Must be 32-byte aligned.</TD>
37  </tr>
38  <tr>
39<TH>size_even</TH>
40<TD>Size of the even-numbered cache (in bytes). Must be in multiples of 32 bytes.</TD>
41  </tr>
42  <tr>
43<TH>tmem_odd</TH>
44<TD>Base pointer to texture memory used for odd-numbered LODs of the mipmap (see table below). Must be 32-byte aligned.</TD>
45  </tr>
46  <tr>
47<TH>size_odd</TH>
48<TD>Size of the odd-numbered cache (in bytes). Must be in multiples of 32 bytes.</TD>
49  </tr>
50</TABLE>
51
52<h2>Return Values</h2>
53<p>None.</p>
54
55<H2>Description</H2>
56<P>This function initializes a texture memory (TMEM) region object for preloading.&nbsp;The region is allocated in TMEM by the application and can be used only as a pre-loaded buffer.&nbsp;Cache regions must be allocated by using the <A href="GXInitTexCacheRegion.html"><CODE>GXInitTexCacheRegion</CODE></A> function. For pre-loaded textures, the size of the region must match the size of the texture.&nbsp;An application can create many region objects and some of them can overlap. No two overlapping regions can be active at the same time, however.</P>
57<P>The maximum size of a region is 512 KB.</P>
58<P>The <A href="../Management/GXInit.html"><CODE>GXInit</CODE></A> function creates no preloading regions. The application should allocate appropriate regions if preloading is necessary. In addition, a cache region and allocator must be created using the <A href="GXInitTexCacheRegion.html"><CODE>GXInitTexCacheRegion</CODE></A> and <A href="GXSetTexRegionCallback.html"><CODE>GXSetTexRegionCallBack</CODE></A> functions. This is because the new cache region may overwrite the preload region. (Alternatively, if you do not use any color index textures, you may preload textures into the portion of texture memory normally allocated to color index usage by the default allocator.))</P>
59
60<H4><B><A name="TMEM_rules">Texture Memory Region Allocation Rules</A></B></H4>
61<P>Texture memory is divided into high and low banks.&nbsp;The first 512 Kbytes is the low bank, the next 512 Kbytes is the high bank.&nbsp;Textures will have their components stored in the banks according to the rules below.&nbsp; Note that no component may span the boundary between two banks. The notation <SPAN class="argument">m:n</SPAN> refers to the address (<SPAN class="argument">m</SPAN>) and size (<SPAN class="argument">n</SPAN>) for a given range of the texture memory. CI is an abbreviation for color-index.</P>
62<TABLE class="arguments" border="1" >
63  <TBODY>
64    <TR>
65<TD width="25%" bgcolor="#C0C0C0"><B>Texture Types</B></TD>
66<TD bgcolor="#C0C0C0"><B>Allocation Rules</B></TD>
67    </TR>
68    <TR>
69<TD>Non-mipmap, non-32 bit RGB, non-CI</TD>
70<TD>Uses only <SPAN class="argument">tmem_even:size_even</SPAN>.<BR>Can use both banks.<BR>The arguments <SPAN class="argument">tmem_odd</SPAN> and <SPAN class="argument">size_odd</SPAN> must both be set to 0.</TD>
71    </TR>
72    <TR>
73<TD>Non-mipmap, 32 bit RGB, non-CI</TD>
74<TD>Color element AR uses <SPAN class="argument">tmem_even:size_even</SPAN>. Must be in the low bank.<BR>Color element GB uses <SPAN class="argument">tmem_odd:size_odd</SPAN>. Must be in the high bank.</TD>
75    </TR>
76    <TR>
77<TD>Non-mipmap, color index</TD>
78<TD>Uses only <SPAN class="argument">tmem_even:size_even</SPAN>. Must be in the low bank.<BR> (The corresponding TLUT will be accessed from the high bank.)<br>)<BR>The arguments <SPAN class="argument">tmem_odd</SPAN> and <SPAN class="argument">size_odd</SPAN> must both be set to 0.</TD>
79    </TR>
80    <TR>
81<TD>Mipmapped, non-32 bit RGB, non-CI</TD>
82<TD>Even-numbered LODs use <SPAN class="argument">tmem_even:size_even</SPAN>. Odd LODs use <SPAN class="argument">tmem_odd:size_odd</SPAN>.<BR>Even LODs may be in the high or low bank. Odd LODs must be in the opposite bank.</TD>
83    </TR>
84    <TR>
85<TD>mipmapped, 32 bit RGB, non-CI&nbsp;</TD>
86<TD>Even (AR) + odd (GB) LODs use <SPAN class="argument">tmem_even:size_even</SPAN>.<BR>Even (GB) + odd (AR) LODs use <SPAN class="argument">tmem_odd:size_odd</SPAN>.</TD>
87    </TR>
88    <TR>
89<TD>mipmapped, color index</TD>
90<TD>Even-numbered LODs use <SPAN class="argument">tmem_even:size_even</SPAN>. Must be in the low bank.<BR>Odd LODs use <SPAN class="argument">tmem_odd:size_odd</SPAN>. Must be in the low bank.<BR>Be aware that trilinear filtering will not work for this texture type.</TD>
91    </TR>
92  </TBODY>
93</TABLE>
94
95<h2>See Also</h2>
96<P class="reference">
97<A href="GXInitTexCacheRegion.html">GXInitTexCacheRegion</A>,
98<A href="GXSetTexRegionCallback.html">GXSetTexRegionCallBack</A>,
99<A href="GXInitTlutRegion.html">GXInitTlutRegion</A>,
100<A href="GXSetTlutRegionCallback.html">GXSetTlutRegionCallBack</A>,
101<A href="GXGetTexRegionAll.html">GXGetTexRegionAll</A>,
102<a href="GXTMEMDefault.html">GX Default TMEM Configuration</a>
103</p>
104
105<H2>Revision History</H2>
106<P>
1072006/03/01 Initial version.<br>
108</P>
109
110<hr><p>CONFIDENTIAL</p></body>
111</HTML>
112