#define MACH64_FALLBACK_READ_BUFFER 0x0004
#define MACH64_FALLBACK_STENCIL 0x0008
#define MACH64_FALLBACK_RENDER_MODE 0x0010
-#define MACH64_FALLBACK_MULTIDRAW 0x0020
-#define MACH64_FALLBACK_LOGICOP 0x0040
-#define MACH64_FALLBACK_SEP_SPECULAR 0x0080
-#define MACH64_FALLBACK_BLEND_EQ 0x0100
-#define MACH64_FALLBACK_BLEND_FUNC 0x0200
-#define MACH64_FALLBACK_DISABLE 0x0400
+#define MACH64_FALLBACK_LOGICOP 0x0020
+#define MACH64_FALLBACK_SEP_SPECULAR 0x0040
+#define MACH64_FALLBACK_BLEND_EQ 0x0080
+#define MACH64_FALLBACK_BLEND_FUNC 0x0100
+#define MACH64_FALLBACK_DISABLE 0x0200
#define CARD32 GLuint /* KW: For building in mesa tree */
#define DEBUG_VERBOSE_PRIMS 0x040
#define DEBUG_VERBOSE_COUNT 0x080
#define DEBUG_NOWAIT 0x100
+#define DEBUG_VERBOSE_FALLBACK 0x200
#endif /* __MACH64_CONTEXT_H__ */
/* 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 (mode != ADD)",
+ "glBlendFunc",
+ "Rasterization disable",
+};
+
+
+static const char *getFallbackString(GLuint bit)
+{
+ int i = 0;
+ while (bit > 1) {
+ i++;
+ bit >>= 1;
+ }
+ return fallbackStrings[i];
+}
+
void mach64Fallback( GLcontext *ctx, GLuint bit, GLboolean mode )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint oldfallback = mmesa->Fallback;
if (mode) {
- if (MACH64_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf(stderr,"Set Fallback: %d\n", bit);
mmesa->Fallback |= bit;
if (oldfallback == 0) {
FLUSH_BATCH( mmesa );
_swsetup_Wakeup( ctx );
mmesa->RenderIndex = ~0;
+ if (MACH64_DEBUG & DEBUG_VERBOSE_FALLBACK) {
+ fprintf(stderr, "Mach64 begin rasterization fallback: 0x%x %s\n",
+ bit, getFallbackString(bit));
+ }
}
}
else {
- if (MACH64_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf(stderr,"Clear Fallback: %d\n", bit);
mmesa->Fallback &= ~bit;
if (oldfallback == bit) {
_swrast_flush( ctx );
tnl->Driver.Render.BuildVertices = mach64BuildVertices;
mmesa->NewGLState |= (_MACH64_NEW_RENDER_STATE|
_MACH64_NEW_VERTEX_STATE);
+ if (MACH64_DEBUG & DEBUG_VERBOSE_FALLBACK) {
+ fprintf(stderr, "Mach64 end rasterization fallback: 0x%x %s\n",
+ bit, getFallbackString(bit));
+ }
}
}
}