summaryrefslogtreecommitdiff
path: root/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c')
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c48
1 files changed, 28 insertions, 20 deletions
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c
index 4cb7efaba..293c42fd7 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c
@@ -43,9 +43,22 @@
#include "tdfx_render.h"
#include "tdfx_pipeline.h"
#include "tdfx_span.h"
+#include "tdfx_tex.h"
#include "tdfx_texman.h"
#include "extensions.h"
+#ifndef TDFX_DEBUG
+int TDFX_DEBUG = (0
+/* | DEBUG_ALWAYS_SYNC */
+/* | DEBUG_VERBOSE_API */
+/* | DEBUG_VERBOSE_MSG */
+/* | DEBUG_VERBOSE_LRU */
+/* | DEBUG_VERBOSE_DRI */
+/* | DEBUG_VERBOSE_IOCTL */
+/* | DEBUG_VERBOSE_2D */
+/* | DEBUG_VERBOSE_TEXTURE */
+ );
+#endif
#if 0
@@ -75,15 +88,13 @@ static void tdfxDDInitExtensions( GLcontext *ctx )
gl_extensions_disable( ctx, "GL_INGR_blend_func_separate" );
gl_extensions_enable( ctx, "GL_HP_occlusion_test" );
- if ( !fxMesa->haveTwoTMUs ) {
+ if ( fxMesa->numTMUs == 1 ) {
gl_extensions_disable( ctx, "GL_EXT_texture_env_add" );
gl_extensions_disable( ctx, "GL_ARB_multitexture" );
}
if ( TDFX_IS_NAPALM( fxMesa ) ) {
- gl_extensions_enable( ctx, "GL_ARB_texture_compression" );
gl_extensions_enable( ctx, "GL_EXT_texture_env_combine" );
- gl_extensions_enable( ctx, "GL_3DFX_texture_compression_FXT1" );
}
if (fxMesa->haveHwStencil) {
@@ -178,16 +189,10 @@ GLboolean tdfxCreateContext( Display *dpy, GLvisual *mesaVis,
fxMesa->Glide.Initialized = GL_FALSE;
fxMesa->Glide.Board = 0;
-
- if (getenv("FX_EMULATE_SINGLE_TMU")) {
- fxMesa->haveTwoTMUs = GL_FALSE;
- }
- else {
- if ( TDFX_IS_BANSHEE( fxMesa ) ) {
- fxMesa->haveTwoTMUs = GL_FALSE;
- } else {
- fxMesa->haveTwoTMUs = GL_TRUE;
- }
+ if ( getenv( "FX_EMULATE_SINGLE_TMU" ) || TDFX_IS_BANSHEE( fxMesa ) ) {
+ fxMesa->numTMUs = 1;
+ } else {
+ fxMesa->numTMUs = 2;
}
fxMesa->stats.swapBuffer = 0;
@@ -218,6 +223,7 @@ GLboolean tdfxCreateContext( Display *dpy, GLvisual *mesaVis,
tdfxDDInitStateFuncs( ctx );
tdfxDDInitRenderFuncs( ctx );
tdfxDDInitSpanFuncs( ctx );
+ tdfxDDInitTextureFuncs( ctx );
ctx->Driver.TriangleCaps = (DD_TRI_CULL |
DD_TRI_LIGHT_TWOSIDE |
@@ -448,19 +454,21 @@ void tdfxDestroyContext( tdfxContextPtr fxMesa )
}
if ( fxMesa ) {
- if (fxMesa->glCtx->Shared->RefCount == 1) {
+ GLcontext *ctx = fxMesa->glCtx;
+ struct gl_texture_object *tObj;
+
+ if ( ctx->Shared->RefCount == 1 ) {
/* This share group is about to go away, free our private
* texture object data.
*/
- struct gl_texture_object *tObj;
- tObj = fxMesa->glCtx->Shared->TexObjectList;
- while (tObj) {
- tdfxTMFreeTexture(fxMesa, tObj);
- tObj = tObj->Next;
+ LOCK_HARDWARE( fxMesa );
+ for ( tObj = ctx->Shared->TexObjectList ; tObj ; tObj = tObj->Next ) {
+ tdfxTMFreeTextureLocked( fxMesa, tObj );
}
+ UNLOCK_HARDWARE( fxMesa );
}
- tdfxTMClose(fxMesa); /* free texture memory */
+ tdfxTMClose( fxMesa ); /* free texture memory */
XFree( fxMesa );
}