mesa: add KHR_no_error support to glDrawRangeElements*()
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 8 Jun 2017 06:15:58 +0000 (16:15 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 8 Jun 2017 23:58:07 +0000 (09:58 +1000)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/mesa/vbo/vbo_exec_array.c

index 437d260748439211d92d957edaa40b398748162f..4f86d196dbce45f8b93e2c877cc5f6eb4b37b30d 100644 (file)
@@ -948,9 +948,16 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end,
                   _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