Merge branch 'mesa_7_6_branch'
authorBrian Paul <brianp@vmware.com>
Thu, 24 Sep 2009 22:06:21 +0000 (16:06 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 24 Sep 2009 22:06:21 +0000 (16:06 -0600)
Conflicts:

src/mesa/vbo/vbo_exec_array.c

1  2 
src/gallium/drivers/softpipe/sp_screen.c
src/mesa/drivers/dri/intel/intel_generatemipmap.c
src/mesa/main/enable.c
src/mesa/main/mtypes.h
src/mesa/vbo/vbo_exec_array.c

Simple merge
Simple merge
@@@ -666,35 -663,32 +666,40 @@@ vbo_validated_drawrangeelements(GLconte
  }
  
  static void GLAPIENTRY
 -vbo_exec_DrawRangeElements(GLenum mode,
 -                         GLuint start, GLuint end,
 -                         GLsizei count, GLenum type, const GLvoid *indices)
 +vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
 +                                   GLuint start, GLuint end,
 +                                   GLsizei count, GLenum type,
 +                                   const GLvoid *indices,
 +                                   GLint basevertex)
  {
+    static GLuint warnCount = 0;
     GET_CURRENT_CONTEXT(ctx);
  
     if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count,
 -                                          type, indices ))
 +                                          type, indices, basevertex ))
        return;
  
 +   /* NOTE: It's important that 'end' is a reasonable value.
 +    * in _tnl_draw_prims(), we use end to determine how many vertices
 +    * to transform.  If it's too large, we can unnecessarily split prims
 +    * or we can read/write out of memory in several different places!
 +    */
 +
     if (end >= ctx->Array.ArrayObj->_MaxElement) {
        /* the max element is out of bounds of one or more enabled arrays */
-       _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, count %d, "
-                     "type 0x%x, indices %p, base %d)\n"
-                     "\tend is out of bounds (max=%u)  "
-                     "Element Buffer %u (size %d)\n"
-                     "\tThis should probably be fixed in the application.",
-                     start, end, count, type, indices, basevertex,
-                     ctx->Array.ArrayObj->_MaxElement - 1,
-                     ctx->Array.ElementArrayBufferObj->Name,
-                     ctx->Array.ElementArrayBufferObj->Size);
+       warnCount++;
+       if (warnCount < 10) {
+          _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, count %d, "
+                        "type 0x%x, indices=%p)\n"
+                        "\tend is out of bounds (max=%u)  "
+                        "Element Buffer %u (size %d)\n"
+                        "\tThis should probably be fixed in the application.",
+                        start, end, count, type, indices,
+                        ctx->Array.ArrayObj->_MaxElement - 1,
+                        ctx->Array.ElementArrayBufferObj->Name,
+                        ctx->Array.ElementArrayBufferObj->Size);
+       }
  
        if (0)
           dump_element_buffer(ctx, type);