mesa: Warn when indices are out of bounds, but do not skip the draw in debug builds.
authorBrian Paul <brianp@vmware.com>
Fri, 29 Jan 2010 15:31:48 +0000 (08:31 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 29 Jan 2010 15:31:48 +0000 (08:31 -0700)
The driver (or preferably the hardware) should handle out of bounds
indices.

If there are problems then it's better to detect those in the debug
builds.

(cherry picked from commit e3257912e006120f6ab611e77005eed1a464030a)

src/mesa/vbo/vbo_exec_array.c

index d6452cb6640b7d1f1a8413524a6f7fecbf2b5efd..392da43c5e08989ea27db13cb2cda64b150f9c69 100644 (file)
@@ -722,8 +722,7 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
 
 #ifdef DEBUG
       /* 'end' was out of bounds, but now let's check the actual array
-       * indexes to see if any of them are out of bounds.  If so, warn
-       * and skip the draw to avoid potential segfault, etc.
+       * indexes to see if any of them are out of bounds.
        */
       {
          GLuint max = _mesa_max_buffer_index(ctx, count, type, indices,
@@ -740,7 +739,6 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
                              ctx->Array.ElementArrayBufferObj->Name,
                              ctx->Array.ElementArrayBufferObj->Size);
             }
-            return;
          }
          /* XXX we could also find the min index and compare to 'start'
           * to see if start is correct.  But it's more likely to get the