/* * After a context switch this function will be called to restore * texture memory for the new context. */ void tdfxTMRestoreTextures_NoLock( tdfxContextPtr fxMesa ) { GLcontext *ctx = fxMesa->glCtx; struct gl_texture_object *tObj; int i; for ( tObj = ctx->Shared->TexObjectList ; tObj ; tObj = tObj->Next ) { tdfxTexInfo *ti = TDFX_TEXTURE_DATA( tObj ); if ( ti && ti->isInTM ) { for ( i = 0 ; i < MAX_TEXTURE_UNITS ; i++ ) { if ( ctx->Texture.Unit[i]._Current == tObj ) { tdfxTMDownloadTexture( fxMesa, tObj ); break; } } if ( i == MAX_TEXTURE_UNITS ) { tdfxTMMoveOutTM_NoLock( fxMesa, tObj ); } } } /* VerifyFreeList(fxMesa, 0); VerifyFreeList(fxMesa, 1); */ }
static void uploadTextureImages( tdfxContextPtr fxMesa ) { GLcontext *ctx = fxMesa->glCtx; int unit; for (unit = 0; unit < TDFX_NUM_TMU; unit++) { if (ctx->Texture.Unit[unit]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) { struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current; tdfxTexInfo *ti = TDFX_TEXTURE_DATA(tObj); if (ti && ti->reloadImages && ti->whichTMU != TDFX_TMU_NONE) { /* printf("download texture image on unit %d\n", unit); */ tdfxTMDownloadTexture(fxMesa, tObj); ti->reloadImages = GL_FALSE; } } } }