as other drivers.tags/mesa_20050610
@@ -152,6 +152,15 @@ static const struct tnl_pipeline_stage *tdfx_pipeline[] = { | |||
0, | |||
}; | |||
static const struct dri_debug_control debug_control[] = | |||
{ | |||
{ "dri", DEBUG_VERBOSE_DRI }, | |||
{ "sync", DEBUG_ALWAYS_SYNC }, | |||
{ "api", DEBUG_VERBOSE_API }, | |||
{ "fall", DEBUG_VERBOSE_FALL }, | |||
{ NULL, 0 } | |||
}; | |||
GLboolean tdfxCreateContext( const __GLcontextModes *mesaVis, | |||
__DRIcontextPrivate *driContextPriv, | |||
void *sharedContextPrivate ) | |||
@@ -320,6 +329,10 @@ GLboolean tdfxCreateContext( const __GLcontextModes *mesaVis, | |||
tdfxInitVB( ctx ); | |||
tdfxInitState( fxMesa ); | |||
#if DO_DEBUG | |||
TDFX_DEBUG = driParseDebugString( getenv( "TDFX_DEBUG" ), debug_control ); | |||
#endif | |||
if (driQueryOptionb(&fxMesa->optionCache, "no_rast")) { | |||
fprintf(stderr, "disabling 3D acceleration\n"); | |||
FALLBACK(fxMesa, TDFX_FALLBACK_DISABLE, 1); | |||
@@ -534,14 +547,6 @@ tdfxInitContext( __DRIdrawablePrivate *driDrawPriv, tdfxContextPtr fxMesa ) | |||
UNLOCK_HARDWARE( fxMesa ); | |||
{ | |||
const char *debug = getenv("LIBGL_DEBUG"); | |||
if (debug && strstr(debug, "fallbacks")) { | |||
fxMesa->debugFallbacks = GL_TRUE; | |||
} | |||
} | |||
fxMesa->numClipRects = 0; | |||
fxMesa->pClipRects = NULL; | |||
fxMesa->scissoredClipRects = GL_FALSE; |
@@ -919,8 +919,6 @@ struct tdfx_context { | |||
tdfxStats stats; | |||
GLboolean debugFallbacks; | |||
/* Configuration cache | |||
*/ | |||
driOptionCache optionCache; | |||
@@ -990,7 +988,7 @@ static __inline__ GrColor_t tdfxPackColor( GLuint cpp, | |||
} | |||
} | |||
#define DO_DEBUG 0 | |||
#define DO_DEBUG 1 | |||
#if DO_DEBUG | |||
extern int TDFX_DEBUG; | |||
#else | |||
@@ -999,11 +997,8 @@ extern int TDFX_DEBUG; | |||
#define DEBUG_ALWAYS_SYNC 0x01 | |||
#define DEBUG_VERBOSE_API 0x02 | |||
#define DEBUG_VERBOSE_MSG 0x04 | |||
#define DEBUG_VERBOSE_LRU 0x08 | |||
#define DEBUG_VERBOSE_DRI 0x10 | |||
#define DEBUG_VERBOSE_IOCTL 0x20 | |||
#define DEBUG_VERBOSE_2D 0x40 | |||
#define DEBUG_VERBOSE_DRI 0x04 | |||
#define DEBUG_VERBOSE_FALL 0x08 | |||
/* conf */ | |||
#define FX_COMPRESS_S3TC_AS_FXT1_HACK 1 |
@@ -53,15 +53,7 @@ int prevLockLine = 0; | |||
#endif | |||
#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 */ | |||
); | |||
int TDFX_DEBUG = 0; | |||
#endif | |||
PUBLIC const char __driConfigOptions[] = |
@@ -1213,7 +1213,7 @@ static char *fallbackStrings[] = { | |||
"Texture border", | |||
"glColorMask", | |||
"blend mode", | |||
"line stipple" | |||
"line stipple", | |||
"Rasterization disable" | |||
}; | |||
@@ -1242,7 +1242,7 @@ void tdfxFallback( GLcontext *ctx, GLuint bit, GLboolean mode ) | |||
FLUSH_BATCH(fxMesa); | |||
_swsetup_Wakeup( ctx ); | |||
fxMesa->RenderIndex = ~0; | |||
if (fxMesa->debugFallbacks) { | |||
if (TDFX_DEBUG & DEBUG_VERBOSE_FALL) { | |||
fprintf(stderr, "Tdfx begin software fallback: 0x%x %s\n", | |||
bit, getFallbackString(bit)); | |||
} | |||
@@ -1259,7 +1259,7 @@ void tdfxFallback( GLcontext *ctx, GLuint bit, GLboolean mode ) | |||
tnl->Driver.Render.BuildVertices = tdfxBuildVertices; | |||
fxMesa->new_gl_state |= (_TDFX_NEW_RENDERSTATE| | |||
_TDFX_NEW_RASTERSETUP); | |||
if (fxMesa->debugFallbacks) { | |||
if (TDFX_DEBUG & DEBUG_VERBOSE_FALL) { | |||
fprintf(stderr, "Tdfx end software fallback: 0x%x %s\n", | |||
bit, getFallbackString(bit)); | |||
} |