r300g: implement MSAA
[mesa.git] / src / gallium / auxiliary / util / u_draw.c
index 1f3eb887959ca619587335cfe01b9b21f413d48d..83d9284b895c7847518b82d9f579df70ec083c16 100644 (file)
@@ -44,7 +44,6 @@
 unsigned
 util_draw_max_index(
       const struct pipe_vertex_buffer *vertex_buffers,
-      unsigned nr_vertex_buffers,
       const struct pipe_vertex_element *vertex_elements,
       unsigned nr_vertex_elements,
       const struct pipe_draw_info *info)
@@ -109,8 +108,15 @@ util_draw_max_index(
          else {
             /* Per-instance data. Simply make sure the state tracker didn't
              * request more instances than those that fit in the buffer */
-            assert((info->start_instance + info->instance_count)/element->instance_divisor
-                   <= (buffer_max_index + 1));
+            if ((info->start_instance + info->instance_count)/element->instance_divisor
+                > (buffer_max_index + 1)) {
+               /* FIXME: We really should stop thinking in terms of maximum
+                * indices/instances and simply start clamping against buffer
+                * size. */
+               debug_printf("%s: too many instances for vertex buffer\n",
+                            __FUNCTION__);
+               return 0;
+            }
          }
       }
    }