i965: Remove artificial dependency between math instructions.
[mesa.git] / src / mesa / state_tracker / st_atom_framebuffer.c
index a17417c3590a1c3ae08fcaaac4f5f9f0fbcdb020..b195c55b347e4fa8ee534433e9732615c2605fe1 100644 (file)
@@ -113,6 +113,12 @@ update_framebuffer_state( struct st_context *st )
       pipe_surface_reference(&framebuffer->cbufs[i], NULL);
    }
 
+   /* Remove trailing GL_NONE draw buffers. */
+   while (framebuffer->nr_cbufs &&
+          !framebuffer->cbufs[framebuffer->nr_cbufs-1]) {
+      framebuffer->nr_cbufs--;
+   }
+
    /*
     * Depth/Stencil renderbuffer/surface.
     */
@@ -147,11 +153,10 @@ update_framebuffer_state( struct st_context *st )
    }
 #endif
 
-   /* _mesa_test_framebuffer_completeness refuses framebuffers with no
-    * attachments, so this should never happen.
-    */
-   assert(framebuffer->width  != UINT_MAX);
-   assert(framebuffer->height != UINT_MAX);
+   if (framebuffer->width == UINT_MAX)
+      framebuffer->width = 0;
+   if (framebuffer->height == UINT_MAX)
+      framebuffer->height = 0;
 
    cso_set_framebuffer(st->cso_context, framebuffer);
 }