summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_exec_array.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-09-24 16:06:21 -0600
committerBrian Paul <[email protected]>2009-09-24 16:06:21 -0600
commit29d27229a95837d085db785a2b4abb654457dafa (patch)
tree0a03c9dbe3e55fa9676137750da1ee465379b978 /src/mesa/vbo/vbo_exec_array.c
parentfd56bee6c4de28da194333f93b52c40f1deb6163 (diff)
parent940ca2e837efe45caae1cf1d9665f6736347705d (diff)
Merge branch 'mesa_7_6_branch'
Conflicts: src/mesa/vbo/vbo_exec_array.c
Diffstat (limited to 'src/mesa/vbo/vbo_exec_array.c')
-rw-r--r--src/mesa/vbo/vbo_exec_array.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index 668dc6eb24c..774cffc451b 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -672,6 +672,7 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
const GLvoid *indices,
GLint basevertex)
{
+ static GLuint warnCount = 0;
GET_CURRENT_CONTEXT(ctx);
if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count,
@@ -686,15 +687,19 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
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);
@@ -711,16 +716,17 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
GLuint max = _mesa_max_buffer_index(ctx, count, type, indices,
ctx->Array.ElementArrayBufferObj);
if (max >= ctx->Array.ArrayObj->_MaxElement) {
- _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, "
- "count %d, type 0x%x, indices %p, base %p)\n"
- "\tindex=%u is out of bounds (max=%u) "
- "Element Buffer %u (size %d)\n"
- "\tSkipping the glDrawRangeElements() call",
- start, end, count, type, indices, basevertex,
- max,
- ctx->Array.ArrayObj->_MaxElement - 1,
- ctx->Array.ElementArrayBufferObj->Name,
- ctx->Array.ElementArrayBufferObj->Size);
+ if (warnCount < 10) {
+ _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, "
+ "count %d, type 0x%x, indices=%p)\n"
+ "\tindex=%u is out of bounds (max=%u) "
+ "Element Buffer %u (size %d)\n"
+ "\tSkipping the glDrawRangeElements() call",
+ start, end, count, type, indices, max,
+ ctx->Array.ArrayObj->_MaxElement - 1,
+ ctx->Array.ElementArrayBufferObj->Name,
+ ctx->Array.ElementArrayBufferObj->Size);
+ }
return;
}
/* XXX we could also find the min index and compare to 'start'