#if defined(FX)
+#include "hash.h"
#include "fxdrv.h"
int texSwaps = 0;
end = grTexMaxAddress(tmu);
chunk = (fxMesa->type >= GR_SSTTYPE_Banshee) ? (end - start) : FX_2MB_SPLIT;
-
+
if (fxMesa->verbose) {
fprintf(stderr, "Voodoo TMU%d configuration:\n", tmu);
}
int fxTMCheckStartAddr (fxMesaContext fxMesa, GLint tmu, tfxTexInfo *ti)
{
- MemRange *prev, *tmp;
+ MemRange *tmp;
int size;
- struct gl_texture_object *obj;
if (fxMesa->HaveTexUma) {
return FXTRUE;
{
GLuint age, old, lasttime, bindnumber;
GLfloat lowestPriority;
- tfxTexInfo *info;
- struct gl_texture_object *obj, *tmp, *lowestPriorityObj;
+ struct gl_texture_object *obj, *lowestPriorityObj;
+ struct _mesa_HashTable *textures = fxMesa->glCtx->Shared->TexObjects;
+ GLuint id;
- tmp = fxMesa->glCtx->Shared->TexObjectList;
- if (!tmp)
+ if (!_mesa_HashFirstEntry(textures))
return 0;
+
obj = NULL;
old = 0;
lowestPriority = 1.0F;
bindnumber = fxMesa->texBindNumber;
- while (tmp) {
- info = fxTMGetTexInfo(tmp);
+
+ for (id = _mesa_HashFirstEntry(textures);
+ id;
+ id = _mesa_HashNextEntry(textures, id)) {
+ struct gl_texture_object *tmp
+ = (struct gl_texture_object *) _mesa_HashLookup(textures, id);
+ tfxTexInfo *info = fxTMGetTexInfo(tmp);
if (info && info->isInTM &&
((info->whichTMU == tmu) ||
lowestPriorityObj = tmp;
}
}
- tmp = tmp->Next;
}
if (lowestPriorityObj != NULL) {
/*texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info));*/
ti->tm[FX_TMU1] = fxTMAddObj(fxMesa, tObj, FX_TMU1, texmemsize);
- fxMesa->stats.memTexUpload += texmemsize; /* ZZZ: required? */
+ fxMesa->stats.memTexUpload += texmemsize;
for (i = FX_largeLodValue(ti->info), l = ti->minLevel;
i <= FX_smallLodValue(ti->info); i++, l++) {
assert(mml->width > 0);
assert(mml->height > 0);
assert(mml->glideFormat > 0);
+ assert(ti->isInTM);
if (!ti->validated) {
fprintf(stderr, "fxTMReloadMipMapLevel: INTERNAL ERROR: not validated\n");
}
tmu = (int) ti->whichTMU;
-#if 0
- /* [dBorca]
- * We get here by (see Tex[Sub]Image2D), thus we are in TMU.
- * Also, we just set the correct TMU above. fxTMMoveInTM will
- * bail early, so don't bother...
- */
- fxTMMoveInTM(fxMesa, tObj, tmu);
-#else
fxMesa->stats.reqTexUpload++;
fxMesa->stats.texUpload++;
-#endif
lodlevel = ti->info.largeLodLog2 - (level - ti->minLevel);
void
fxTMRestoreTextures_NoLock(fxMesaContext ctx)
{
- tfxTexInfo *ti;
- struct gl_texture_object *tObj;
- int i, where;
-
- tObj = ctx->glCtx->Shared->TexObjectList;
- while (tObj) {
- ti = fxTMGetTexInfo(tObj);
+ struct _mesa_HashTable *textures = ctx->glCtx->Shared->TexObjects;
+ GLuint id;
+
+ for (id = _mesa_HashFirstEntry(textures);
+ id;
+ id = _mesa_HashNextEntry(textures, id)) {
+ struct gl_texture_object *tObj
+ = (struct gl_texture_object *) _mesa_HashLookup(textures, id);
+ tfxTexInfo *ti = fxTMGetTexInfo(tObj);
if (ti && ti->isInTM) {
- for (i = 0; i < MAX_TEXTURE_UNITS; i++)
+ int i;
+ for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
if (ctx->glCtx->Texture.Unit[i]._Current == tObj) {
/* Force the texture onto the board, as it could be in use */
- where = ti->whichTMU;
+ int where = ti->whichTMU;
fxTMMoveOutTM_NoLock(ctx, tObj);
fxTMMoveInTM_NoLock(ctx, tObj, where);
break;
}
+ }
if (i == MAX_TEXTURE_UNITS) /* Mark the texture as off the board */
fxTMMoveOutTM_NoLock(ctx, tObj);
}
- tObj = tObj->Next;
}
}