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>