tex-tc-alloc

Description

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.

Coverage

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)
GXLoadTexObj 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_512K
Same 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.

Using the Demo

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.

Snap Shots

8 x 32-KB regions, algorithm 0.

tex-tc-alloc-0.gif (65589 bytes)

8 x 32-KB regions, algorithm 1.

tex-tc-alloc-1.gif (69301 bytes)

8 x 32-KB regions, algorithm 2.

tex-tc-alloc-2.gif (65942 bytes)

4 x 128-KB regions, algorithm 0.

tex-tc-alloc-3.gif (39186 bytes)

1 x 512-KB region.

tex-tc-alloc-6.gif (13546 bytes)

Data Files Required

$REVOLUTION_SDK_ROOT/dvddata/gxTests/tex-07.tpl

Revision History

2006/03/01 Initial version.


CONFIDENTIAL