DRI_CONF_SECTION_PERFORMANCE
DRI_CONF_MAX_TEXTURE_UNITS(2,1,2)
DRI_CONF_SECTION_END
+ DRI_CONF_SECTION_DEBUG
+ DRI_CONF_NO_RAST(false)
+ DRI_CONF_SECTION_END
DRI_CONF_END;
-static const GLuint __driNConfigOptions = 3;
+static const GLuint __driNConfigOptions = 4;
#ifdef USE_NEW_INTERFACE
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
#endif /* USE_NEW_INTERFACE */
+static const struct dri_debug_control debug_control[] =
+{
+ { "fall", DEBUG_FALLBACKS },
+ { "api", DEBUG_VERBOSE_API },
+ { "lru", DEBUG_VERBOSE_LRU },
+ { NULL, 0 }
+};
#ifndef SAVAGE_DEBUG
-int SAVAGE_DEBUG = (0
-/* | DEBUG_ALWAYS_SYNC */
-/* | DEBUG_VERBOSE_RING */
-/* | DEBUG_VERBOSE_OUTREG */
-/* | DEBUG_VERBOSE_MSG */
-/* | DEBUG_NO_OUTRING */
-/* | DEBUG_NO_OUTREG */
-/* | DEBUG_VERBOSE_API */
-/* | DEBUG_VERBOSE_2D */
-/* | DEBUG_VERBOSE_DRI */
-/* | DEBUG_VALIDATE_RING */
-/* | DEBUG_VERBOSE_IOCTL */
- );
+int SAVAGE_DEBUG = 0;
#endif
imesa->glCtx = ctx;
if (savageDMAInit(imesa) == GL_FALSE)
return GL_FALSE;
-
+
+#ifndef SAVAGE_DEBUG
+ SAVAGE_DEBUG = driParseDebugString( getenv( "SAVAGE_DEBUG" ),
+ debug_control );
+#endif
+
driInitExtensions( ctx, card_extensions, GL_TRUE );
savageDDInitStateFuncs( ctx );
savageDDInitState( imesa );
+ if (driQueryOptionb(&imesa->optionCache, "no_rast"))
+ FALLBACK(ctx, SAVAGE_FALLBACK_NORAST, GL_TRUE);
+
driContextPriv->driverPrivate = (void *) imesa;
return GL_TRUE;
#define SAVAGE_FALLBACK_DRAW_BUFFER 0x2
#define SAVAGE_FALLBACK_READ_BUFFER 0x4
#define SAVAGE_FALLBACK_COLORMASK 0x8
-#define SAVAGE_FALLBACK_STIPPLE 0x10
-#define SAVAGE_FALLBACK_SPECULAR 0x20
-#define SAVAGE_FALLBACK_LOGICOP 0x40
+#define SAVAGE_FALLBACK_SPECULAR 0x10
+#define SAVAGE_FALLBACK_LOGICOP 0x20
/*frank 2001/11/12 add the stencil fallbak*/
-#define SAVAGE_FALLBACK_STENCIL 0x80
-#define SAVAGE_FALLBACK_RENDERMODE 0x100
-#define SAVAGE_FALLBACK_BLEND_EQ 0x200
+#define SAVAGE_FALLBACK_STENCIL 0x40
+#define SAVAGE_FALLBACK_RENDERMODE 0x80
+#define SAVAGE_FALLBACK_BLEND_EQ 0x100
+#define SAVAGE_FALLBACK_NORAST 0x200
+#define SAVAGE_FALLBACK_PROJ_TEXTURE 0x400
#define HW_CULL 1
/* To remove all debugging, make sure SAVAGE_DEBUG is defined as a
* preprocessor symbol, and equal to zero.
*/
-#define SAVAGE_DEBUG 0
#ifndef SAVAGE_DEBUG
-#warning "Debugging enabled - expect reduced performance"
extern int SAVAGE_DEBUG;
#endif
-#define DEBUG_VERBOSE_2D 0x1
-#define DEBUG_VERBOSE_RING 0x8
-#define DEBUG_VERBOSE_OUTREG 0x10
-#define DEBUG_ALWAYS_SYNC 0x40
-#define DEBUG_VERBOSE_MSG 0x80
-#define DEBUG_NO_OUTRING 0x100
-#define DEBUG_NO_OUTREG 0x200
-#define DEBUG_VERBOSE_API 0x400
-#define DEBUG_VALIDATE_RING 0x800
-#define DEBUG_VERBOSE_LRU 0x1000
-#define DEBUG_VERBOSE_DRI 0x2000
-#define DEBUG_VERBOSE_IOCTL 0x4000
+#define DEBUG_FALLBACKS 0x001
+#define DEBUG_VERBOSE_API 0x002
+#define DEBUG_VERBOSE_LRU 0x004
#define TARGET_FRONT 0x0
#define TARGET_BACK 0x1
#define TARGET_DEPTH 0x2
-#define SAVAGEDEBUG 0
-#define _SAVAGE_DEBUG
-/*frank remove the least debug information*/
-#ifdef _SAVAGE_DEBUG
-#define fprintf fprintf
-#else
-#define fprintf(...)
-#endif
-
#define SUBPIXEL_X -0.5
#define SUBPIXEL_Y -0.375
if (imesa->CurrentTexObj[1]) imesa->CurrentTexObj[1]->bound &= ~2;
imesa->CurrentTexObj[0] = 0;
imesa->CurrentTexObj[1] = 0;
- FALLBACK (ctx, SAVAGE_FALLBACK_TEXTURE, GL_FALSE);
savageUpdateTex0State_s4( ctx );
savageUpdateTex1State_s4( ctx );
imesa->dirty |= (SAVAGE_UPLOAD_CTX |
savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
if (imesa->CurrentTexObj[0]) imesa->CurrentTexObj[0]->bound &= ~1;
imesa->CurrentTexObj[0] = 0;
- if (ctx->Texture.Unit[1]._ReallyEnabled) {
- FALLBACK (ctx, SAVAGE_FALLBACK_TEXTURE, GL_TRUE);
- } else {
- FALLBACK (ctx, SAVAGE_FALLBACK_TEXTURE, GL_FALSE);
- savageUpdateTexState_s3d( ctx );
- imesa->dirty |= (SAVAGE_UPLOAD_CTX |
- SAVAGE_UPLOAD_TEX0);
- }
+ savageUpdateTexState_s3d( ctx );
+ imesa->dirty |= (SAVAGE_UPLOAD_CTX |
+ SAVAGE_UPLOAD_TEX0);
}
void savageUpdateTextureState( GLcontext *ctx)
{
savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
+ FALLBACK (ctx, SAVAGE_FALLBACK_TEXTURE, GL_FALSE);
+ FALLBACK(ctx, SAVAGE_FALLBACK_PROJ_TEXTURE, GL_FALSE);
if (imesa->savageScreen->chipset >= S3_SAVAGE4)
savageUpdateTextureState_s4 (ctx);
else
if (index & _TNL_BIT_TEX(0)) {
if (VB->TexCoordPtr[0]->size > 2) {
/* projective textures are not supported by the hardware */
- FALLBACK(ctx, SAVAGE_FALLBACK_TEXTURE, GL_TRUE);
+ FALLBACK(ctx, SAVAGE_FALLBACK_PROJ_TEXTURE, GL_TRUE);
}
if (VB->TexCoordPtr[0]->size == 2)
EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_2F, SAVAGE_EMIT_ST0, SAVAGE_HW_NO_UV0 );
if (index & _TNL_BIT_TEX(1)) {
if (VB->TexCoordPtr[1]->size > 2) {
/* projective textures are not supported by the hardware */
- FALLBACK(ctx, SAVAGE_FALLBACK_TEXTURE, GL_TRUE);
+ FALLBACK(ctx, SAVAGE_FALLBACK_PROJ_TEXTURE, GL_TRUE);
}
if (VB->TexCoordPtr[1]->size == 2)
EMIT_ATTR( _TNL_ATTRIB_TEX1, EMIT_2F, SAVAGE_EMIT_ST1, SAVAGE_HW_NO_UV1 );
/* Transition to/from hardware rasterization. */
/**********************************************************************/
+static const char * const fallbackStrings[] = {
+ "Texture mode",
+ "Draw buffer",
+ "Read buffer",
+ "Color mask",
+ "Specular",
+ "LogicOp",
+ "glEnable(GL_STENCIL) without hw stencil buffer",
+ "glRenderMode(selection or feedback)",
+ "glBlendEquation",
+ "Hardware rasterization disabled",
+ "Projective texture",
+};
+
void savageFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
GLuint oldfallback = imesa->Fallback;
+ GLuint index;
+ for (index = 0; (1 << index) < bit; ++index);
if (mode) {
imesa->Fallback |= bit;
_swsetup_Wakeup( ctx );
imesa->RenderIndex = ~0;
}
+ if (!(oldfallback & bit) && (SAVAGE_DEBUG & DEBUG_FALLBACKS))
+ fprintf (stderr, "Savage begin fallback: 0x%x %s\n",
+ bit, fallbackStrings[index]);
}
else {
imesa->Fallback &= ~bit;
imesa->new_gl_state |= _SAVAGE_NEW_RENDER_STATE;
}
+ if ((oldfallback & bit) && (SAVAGE_DEBUG & DEBUG_FALLBACKS))
+ fprintf (stderr, "Savage end fallback: 0x%x %s\n",
+ bit, fallbackStrings[index]);
}
}