i965: fix hacked Fallback usage in brw_prepare_vertices()
authorBrian Paul <brianp@vmware.com>
Thu, 22 Oct 2009 22:45:50 +0000 (16:45 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 22 Oct 2009 22:52:59 +0000 (16:52 -0600)
Setting intel->Fallback = 1 clobbered any fallback state that was already
set.  Not sure where this hack originated (the git history is a little
convoluted).  Define and use a new BRW_FALLBACK_DRAW bit instead.  This
shouldn't break anything and could potentially fix some bugs (but no
specific ones are known).

src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_draw_upload.c

index da0e091bfdf97aa98ec1449c63a0566222ccc2c3..b1e7ec84650f0fd7852e8ecfb34783c942460d57 100644 (file)
  */
 
 
+#define BRW_FALLBACK_DRAW  (INTEL_FALLBACK_DRIVER << 0)
+
 #define BRW_MAX_CURBE                    (32*16)
 
 struct brw_context;
index 9d089e113e6f5606800d1ba9803b3164c347d24b..4f8ceb37bd0b3b651880ebdf7636cd87d0769988 100644 (file)
@@ -375,9 +375,10 @@ static void brw_prepare_vertices(struct brw_context *brw)
     * isn't an issue at this point.
     */
    if (brw->vb.nr_enabled >= BRW_VEP_MAX) {
-      intel->Fallback = 1;
+      FALLBACK(intel, BRW_FALLBACK_DRAW, GL_TRUE);
       return;
    }
+   FALLBACK(intel, BRW_FALLBACK_DRAW, GL_FALSE);
 
    for (i = 0; i < brw->vb.nr_enabled; i++) {
       struct brw_vertex_element *input = brw->vb.enabled[i];
@@ -427,9 +428,10 @@ static void brw_prepare_vertices(struct brw_context *brw)
            /* Position array not properly enabled:
             */
             if (input->glarray->StrideB == 0) {
-               intel->Fallback = 1;
+               FALLBACK(intel, BRW_FALLBACK_DRAW, GL_TRUE);
                return;
             }
+            FALLBACK(intel, BRW_FALLBACK_DRAW, GL_FALSE);
 
            interleave = input->glarray->StrideB;
            ptr = input->glarray->Ptr;