Reviewed-by: Nicolai Hähnle <nicolai.haeh...@amd.com>

On 08.06.2017 08:15, Timothy Arceri wrote:
---
  src/mesa/vbo/vbo_exec_array.c | 13 ++++++++++---
  1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index 437d260..4f86d19 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -941,23 +941,30 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, GLuint 
start, GLuint end,
     GLuint max_element = 2 * 1000 * 1000 * 1000; /* just a big number */
GET_CURRENT_CONTEXT(ctx); if (MESA_VERBOSE & VERBOSE_DRAW)
        _mesa_debug(ctx,
                    "glDrawRangeElementsBaseVertex(%s, %u, %u, %d, %s, %p, 
%d)\n",
                    _mesa_enum_to_string(mode), start, end, count,
                    _mesa_enum_to_string(type), indices, basevertex);
- if (!_mesa_validate_DrawRangeElements(ctx, mode, start, end, count,
-                                         type, indices))
-      return;
+   if (_mesa_is_no_error_enabled(ctx)) {
+      FLUSH_CURRENT(ctx, 0);
+
+      if (ctx->NewState)
+         _mesa_update_state(ctx);
+   } else {
+      if (!_mesa_validate_DrawRangeElements(ctx, mode, start, end, count,
+                                            type, indices))
+         return;
+   }
if ((int) end + basevertex < 0 || start + basevertex >= max_element) {
        /* The application requested we draw using a range of indices that's
         * outside the bounds of the current VBO.  This is invalid and appears
         * to give undefined results.  The safest thing to do is to simply
         * ignore the range, in case the application botched their range 
tracking
         * but did provide valid indices.  Also issue a warning indicating that
         * the application is broken.
         */
        if (warnCount++ < 10) {



--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to