diff options
author | Eric Anholt <[email protected]> | 2005-10-19 03:23:29 +0000 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2005-10-19 03:23:29 +0000 |
commit | 2420318cd9d42e1dda43e9e6ffb0accae1ff6b02 (patch) | |
tree | 56100db0cab3f1325ee272236b5408a655163b86 /src/mesa/drivers/dri/sis/sis_tris.c | |
parent | e0cb784e03530d2c806e74b3ac9b66021b5791ce (diff) |
Make SiS a little more like other drivers: Add SIS_DEBUG (only option being
"fall" so far) and make the fallback_force option be no_rast like other drivers.
Incidentally, makes no_rast not crash (though it still fails to render).
Diffstat (limited to 'src/mesa/drivers/dri/sis/sis_tris.c')
-rw-r--r-- | src/mesa/drivers/dri/sis/sis_tris.c | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/sis/sis_tris.c b/src/mesa/drivers/dri/sis/sis_tris.c index fb0fd1ac099..0c70f26b637 100644 --- a/src/mesa/drivers/dri/sis/sis_tris.c +++ b/src/mesa/drivers/dri/sis/sis_tris.c @@ -959,6 +959,27 @@ void sisFlushPrims(sisContextPtr smesa) /* Transition to/from hardware rasterization. */ /**********************************************************************/ +static const char * const fallbackStrings[] = { + "Texture mode", + "Texture 0 mode", + "Texture 1 moder", + "Texture 0 env", + "Texture 1 env", + "glDrawBuffer(GL_FRONT_AND_BACK)", + "glEnable(GL_STENCIL) without hw stencil buffer", + "no_rast", +}; + +static const char *getFallbackString(GLuint bit) +{ + int i = 0; + while (bit > 1) { + i++; + bit >>= 1; + } + return fallbackStrings[i]; +} + void sisFallback( GLcontext *ctx, GLuint bit, GLboolean mode ) { TNLcontext *tnl = TNL_CONTEXT(ctx); @@ -971,6 +992,10 @@ void sisFallback( GLcontext *ctx, GLuint bit, GLboolean mode ) SIS_FIREVERTICES(smesa); _swsetup_Wakeup( ctx ); smesa->RenderIndex = ~0; + if (SIS_DEBUG & DEBUG_FALLBACKS) { + fprintf(stderr, "SiS begin rasterization fallback: 0x%x %s\n", + bit, getFallbackString(bit)); + } } } else { @@ -993,6 +1018,10 @@ void sisFallback( GLcontext *ctx, GLuint bit, GLboolean mode ) smesa->hw_viewport, 0 ); smesa->NewGLState |= _SIS_NEW_RENDER_STATE; + if (SIS_DEBUG & DEBUG_FALLBACKS) { + fprintf(stderr, "SiS end rasterization fallback: 0x%x %s\n", + bit, getFallbackString(bit)); + } } } } @@ -1046,11 +1075,6 @@ void sisInitTriFuncs( GLcontext *ctx ) sis_vert_init_gwst0t1(); } - if (driQueryOptionb(&smesa->optionCache, "fallback_force")) - sisFallback(ctx, SIS_FALLBACK_FORCE, 1); - else - sisFallback(ctx, SIS_FALLBACK_FORCE, 0); - smesa->RenderIndex = ~0; smesa->NewGLState |= _SIS_NEW_RENDER_STATE; |