summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/tdfx/tdfx_context.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-02-05 17:37:00 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-02-05 17:37:00 +0000
commitcf899d400d480d7017311d92f2cfd94391b785b4 (patch)
tree35b6624df25af2c3112ec58ce4eb7131d9b8a034 /src/mesa/drivers/dri/tdfx/tdfx_context.c
parent557dce9bc2e9a705a08969bef110f870ca8b37e3 (diff)
removed need for Shared->TexObjectList, walk over texture hash table entries instead
Diffstat (limited to 'src/mesa/drivers/dri/tdfx/tdfx_context.c')
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_context.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c
index c1491ce472..e251c03a1c 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_context.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c
@@ -49,6 +49,7 @@
#include "tdfx_span.h"
#include "tdfx_texman.h"
#include "extensions.h"
+#include "hash.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
@@ -560,12 +561,24 @@ tdfxDestroyContext( __DRIcontextPrivate *driContextPriv )
/* This share group is about to go away, free our private
* texture object data.
*/
+#if 0
struct gl_texture_object *tObj;
tObj = fxMesa->glCtx->Shared->TexObjectList;
while (tObj) {
tdfxTMFreeTexture(fxMesa, tObj);
tObj = tObj->Next;
}
+#else
+ struct _mesa_HashTable *textures = fxMesa->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);
+ tdfxTMFreeTexture(fxMesa, tObj);
+ }
+#endif
}
tdfxTMClose(fxMesa); /* free texture memory */