diff options
author | Eric Anholt <[email protected]> | 2004-10-08 23:03:38 +0000 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2004-10-08 23:03:38 +0000 |
commit | ea6f4f6079de8f35b6e3d597525d958bcedc7bad (patch) | |
tree | 54524daf86b78d8495b5150284dd371d48928e34 /src/mesa/drivers/dri/r128/r128_tris.c | |
parent | b4d269f35f0f0e0c87793a319a77f571a54a5a47 (diff) |
Add fallback debugging (R128_DEBUG=fall) output, and set DO_DEBUG=1 by default
so that we can use the env var to get output. Add a no_rast driconf option to
force software fallbacks.
Diffstat (limited to 'src/mesa/drivers/dri/r128/r128_tris.c')
-rw-r--r-- | src/mesa/drivers/dri/r128/r128_tris.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r128/r128_tris.c b/src/mesa/drivers/dri/r128/r128_tris.c index 34d7c7ffee7..7e72467da5d 100644 --- a/src/mesa/drivers/dri/r128/r128_tris.c +++ b/src/mesa/drivers/dri/r128/r128_tris.c @@ -650,6 +650,31 @@ static void r128RenderFinish( GLcontext *ctx ) /* Transition to/from hardware rasterization. */ /**********************************************************************/ +static const char * const fallbackStrings[] = { + "Texture mode", + "glDrawBuffer(GL_FRONT_AND_BACK)", + "glReadBuffer", + "glEnable(GL_STENCIL) without hw stencil buffer", + "glRenderMode(selection or feedback)", + "glLogicOp (mode != GL_COPY)", + "GL_SEPARATE_SPECULAR_COLOR", + "glBlendEquation", + "glBlendFunc(mode != ADD)", + "Projective texture", + "Rasterization disable", +}; + + +static const char *getFallbackString(GLuint bit) +{ + int i = 0; + while (bit > 1) { + i++; + bit >>= 1; + } + return fallbackStrings[i]; +} + void r128Fallback( GLcontext *ctx, GLuint bit, GLboolean mode ) { TNLcontext *tnl = TNL_CONTEXT(ctx); @@ -662,6 +687,10 @@ void r128Fallback( GLcontext *ctx, GLuint bit, GLboolean mode ) FLUSH_BATCH( rmesa ); _swsetup_Wakeup( ctx ); rmesa->RenderIndex = ~0; + if ( R128_DEBUG & DEBUG_VERBOSE_FALL ) { + fprintf(stderr, "R128 begin rasterization fallback: 0x%x %s\n", + bit, getFallbackString(bit)); + } } } else { @@ -684,6 +713,10 @@ void r128Fallback( GLcontext *ctx, GLuint bit, GLboolean mode ) rmesa->hw_viewport, 0 ); rmesa->NewGLState |= _R128_NEW_RENDER_STATE; + if ( R128_DEBUG & DEBUG_VERBOSE_FALL ) { + fprintf(stderr, "R128 end rasterization fallback: 0x%x %s\n", + bit, getFallbackString(bit)); + } } } } @@ -719,6 +752,4 @@ void r128InitTriFuncs( GLcontext *ctx ) rmesa->tnl_state = -1; rmesa->NewGLState |= _R128_NEW_RENDER_STATE; - -/* r128Fallback( ctx, 0x100000, 1 ); */ } |