Table of Contents Glide Programming Guide



Download 6.22 Mb.
Page75/106
Date03.02.2023
Size6.22 Mb.
#60547
1   ...   71   72   73   74   75   76   77   78   ...   106
GLIDEPGM

2Replacing a Single LOD


One form of simple texture memory management requires only that the application swap mipmaps with identical memory footprints (i.e. same format, dimensions, and mipmap levels) in and out of the same texture memory area. Texture replacement is a simple facility for doing texture map animation, and it is also a method of doing dynamic texture management: the local texture buffer is split into discrete texture regions that are updated as needed. To replace a mipmap use the Glide function grTexDownloadMipMap() with new data. Alternatively, an application can swap out individual mipmap levels within a mipmap using grTexDownloadMipMapLevel().
void grTexDownloadMipMapLevel( GrChipID_t tmu,
FxU32 startAddress,
GrLOD_t thisLOD,
GrLOD_t largeLOD,
GrAspectRatio_t aspectRatio,
GrTextureFormat_t format,
FxU32 evenOdd,
void *data
)
grTexDownloadMipMapLevel() replaces a single mipmap level in a previously downloaded mipmap that begins at startAddress. Argument largeLOD specifies the largest (and first) LOD in the downloaded mipmap; the aspectRatio and format locate the first texel of thisLOD. The data argument points to the first texel of the new LOD, as shown in Figure Managing Texture Memory.4.
Figure Managing Texture Memory.4 Replacing a single LOD.
Suppose a mipmap has been loaded into TMU1 with the following command and data.
grTexDownloadMipMap(GR_TMU1,startAddress,GR_MIPMAPLEVELMASK_BOTH, info)

To replace GR_LOD_128, use the following call to grTexDownloadMipMapLevel().


3Replacing Part of an LOD


Applications that want to replace one of the large LODs in a mipmap, but also want to maintain a snappy frame rate, may opt to replace the LOD a few rows at a time with grTexDownloadMipMapLevelPartial().
void grTexDownloadMipMapLevelPartial( GrChipID_t tmu,
FxU32 startAddress,
GrLOD_t thisLOD,
GrLOD_t largeLOD,
GrAspectRatio_t aspectRatio,
GrTextureFormat_t format,
FxU32 evenOdd,
void *data,
int firstRow,
int lastRow
)
The first seven arguments to grTexDownloadMipMapLevelPartial() are the same as those to grTexDownloadMipMapLevel(): the tmu that the texture is loaded on, the starting address, the LOD that will be partially replaced, the largest LOD in the mipmap, the aspect ratio and texture format of the downloaded texture, and the evenOdd flag. The data argument points to a stream of texels that will overwrite those in texture memory, starting at the row firstRow in thisLOD and continuing through lastRow. To download one row of the texture, use the same value for firstRow and lastRow.

Download 6.22 Mb.

Share with your friends:
1   ...   71   72   73   74   75   76   77   78   ...   106




The database is protected by copyright ©ininet.org 2024
send message

    Main page