vbo: Ignore invalid element ranges which are outside VBO bounds.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 8 Feb 2012 13:08:22 +0000 (05:08 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 17 Feb 2012 22:56:44 +0000 (14:56 -0800)
commitf00c97b23f78f3ccd1ea554ceebe7a33de7f81cf
treed461379612be1310d0c7457f9a9633f68f60018f
parentf9be8543aab9005c30b38331b9f7250a01720942
vbo: Ignore invalid element ranges which are outside VBO bounds.

Some applications, such as Regnum Online, appear to pass invalid
start/end values to glDrawRangeElements.  In particular, the 'start'
index sometimes exceeds the maximum array element.  This is clearly
invalid behavior, and although the spec isn't clear, seems to result
in undefined, implementation-specific behavior.

This patch takes the conservative approach and simply ignores the range,
while issuing a warning indicating that the application is broken and
should be fixed.

NOTE: This is a candidate for release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45214
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44701
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41152
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40361
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28138
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/mesa/vbo/vbo_exec_array.c