do {
textureLevels++;
} while ((textureSize >>= 0x1) & 0x7ff);
- fxMesa->textureMaxLod = textureLevels - 1;
ctx->Const.MaxTextureLevels = textureLevels;
+#if 1||FX_RESCALE_BIG_TEXURES
+ fxMesa->textureMaxLod = textureLevels - 1;
if ((env = getenv("MESA_FX_MAXLOD")) != NULL) {
int maxLevels = atoi(env) + 1;
if ((maxLevels <= MAX_TEXTURE_LEVELS) && (maxLevels > textureLevels)) {
ctx->Const.MaxTextureLevels = maxLevels;
}
}
+#endif
}
ctx->Const.MaxTextureCoordUnits =
ctx->Const.MaxTextureImageUnits = fxMesa->haveTwoTMUs ? 2 : 1;
int result;
struct gl_texture_object *obj;
- int real_tmu = tmu;
if (fxMesa->HaveTexUma) {
tmu = FX_TMU0;
}
if (TDFX_DEBUG & VERBOSE_TEXTURE) {
fprintf(stderr, "fxTMFindStartAddr: No free space. Discard oldest\n");
}
- obj = fxTMFindOldestObject(fxMesa, real_tmu);
+ obj = fxTMFindOldestObject(fxMesa, tmu);
if (!obj) {
fprintf(stderr, "fxTMFindStartAddr: ERROR: No space for texture\n");
return -1;
info = fxTMGetTexInfo(tmp);
if (info && info->isInTM &&
- ((info->whichTMU == tmu) || (info->whichTMU == FX_TMU_BOTH) ||
- (info->whichTMU == FX_TMU_SPLIT))) {
+ ((info->whichTMU == tmu) ||
+ (info->whichTMU == FX_TMU_BOTH) ||
+ (info->whichTMU == FX_TMU_SPLIT) ||
+ fxMesa->HaveTexUma
+ )
+ ) {
lasttime = info->lastTimeUsed;
if (lasttime > bindnumber)
}
else {
if (TDFX_DEBUG & VERBOSE_TEXTURE) {
- fprintf(stderr, "fxTMFindOldestObject: %d age=%d\n", obj->Name, old);
+ if (obj != NULL) {
+ fprintf(stderr, "fxTMFindOldestObject: %d age=%d\n", obj->Name, old);
+ }
}
return obj;
}