From: Brian Paul Date: Thu, 24 Sep 2009 22:06:21 +0000 (-0600) Subject: Merge branch 'mesa_7_6_branch' X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=29d27229a95837d085db785a2b4abb654457dafa;p=mesa.git Merge branch 'mesa_7_6_branch' Conflicts: src/mesa/vbo/vbo_exec_array.c --- 29d27229a95837d085db785a2b4abb654457dafa diff --cc src/mesa/vbo/vbo_exec_array.c index 668dc6eb24c,39c2957631a..774cffc451b --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@@ -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);