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.
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.
Algorithm 0 : allocates regions sequentially.
Algorithm 1 : allocates regions according to predefined texture ID.
Algorithm 2 : uses tags, and finds the region currently used by the same texture.
The combination of TMEM configuration and algorithms can be selected using the L and R buttons.
| Functions | Parameters | Description |
GXInitTexObj |
Pointer to image data. | Appropriate value. |
| Width and height | Fixed. | |
| format | Always GX_RGB565. |
|
| Wrap mode (s, t). | Always GX_REPEAT. |
|
| Mipmap | Always GX_TRUE. |
|
GXInitTexObjUserData |
User data pointer | Integer ID numbers |
GXGetTexObjUserData |
(No parameter) | |
|
Destination texture name. | Always GX_TEXMAP0. |
GXInitTexCacheRegion |
32-bit mipmap flag. | Always GX_FALSE. |
| TMEM address (even, odd). | Appropriate lower bank address (even) Appropriate higher bank address (odd) |
|
| Cache size (even, odd). | GX_TEXCACHE_32K, GX_TEXCACHE_128K, GX_TEXCACHE_512KSame value is set for both even and odd numbers. |
|
GXSetTexRegionCallBack |
Callback Functions | Existing Functions |
GXInvalidateTexAll |
(No parameter) | |
GXTexModeSync |
(No parameter) | |
GXSetTevOp |
TEV stage ID. | Always GX_TEVSTAGE0. |
| Operation mode | Always GX_REPLACE. |
START exits the demo.
The Controllser Stick scrolls the screen.
The L and R Buttons toggle the TMEM map mode and callback algorithm.
The X and Y Buttons change the number of quads to draw.
B Button changes the seed value for generating random numbers.
8 x 32-KB regions, algorithm 0.

8 x 32-KB regions, algorithm 1.

8 x 32-KB regions, algorithm 2.

4 x 128-KB regions, algorithm 0.

1 x 512-KB region.

$REVOLUTION_SDK_ROOT/dvddata/gxTests/tex-07.tpl
2006/03/01 Initial version.
CONFIDENTIAL