summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/glide/fxtexman.c
diff options
context:
space:
mode:
authorDaniel Borca <[email protected]>2004-01-14 07:10:12 +0000
committerDaniel Borca <[email protected]>2004-01-14 07:10:12 +0000
commit43ed92b3a1abceb03dd2c0bcc05f466e9a3f620a (patch)
treeb3fe21fa2fc4dcff0246e07085161e216a272bbb /src/mesa/drivers/glide/fxtexman.c
parent067603db91072fc3b02e1583195641972f81168f (diff)
fixed a bug in texture memory manager when in UMA mode
Diffstat (limited to 'src/mesa/drivers/glide/fxtexman.c')
-rw-r--r--src/mesa/drivers/glide/fxtexman.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mesa/drivers/glide/fxtexman.c b/src/mesa/drivers/glide/fxtexman.c
index 2f4a855b309..560a0f4d1be 100644
--- a/src/mesa/drivers/glide/fxtexman.c
+++ b/src/mesa/drivers/glide/fxtexman.c
@@ -197,7 +197,6 @@ fxTMFindStartAddr(fxMesaContext fxMesa, GLint tmu, int size)
int result;
struct gl_texture_object *obj;
- int real_tmu = tmu;
if (fxMesa->HaveTexUma) {
tmu = FX_TMU0;
}
@@ -228,7 +227,7 @@ fxTMFindStartAddr(fxMesaContext fxMesa, GLint tmu, int size)
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;
@@ -336,8 +335,12 @@ fxTMFindOldestObject(fxMesaContext fxMesa, int tmu)
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)
@@ -367,7 +370,9 @@ fxTMFindOldestObject(fxMesaContext fxMesa, int tmu)
}
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;
}