vbo: limit number of warnings to 10
Otherwise some apps will emit tons of warnings.
This commit is contained in:
parent
1d2dca194c
commit
1a81611725
|
@ -667,6 +667,7 @@ vbo_exec_DrawRangeElements(GLenum mode,
|
|||
GLuint start, GLuint end,
|
||||
GLsizei count, GLenum type, const GLvoid *indices)
|
||||
{
|
||||
static GLuint warnCount = 0;
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count,
|
||||
|
@ -675,15 +676,19 @@ vbo_exec_DrawRangeElements(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)\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);
|
||||
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);
|
||||
|
@ -700,15 +705,17 @@ vbo_exec_DrawRangeElements(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)\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);
|
||||
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'
|
||||
|
|
Loading…
Reference in New Issue