summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-03-31 15:38:48 +1100
committerTimothy Arceri <[email protected]>2017-04-19 16:53:25 +1000
commit3d08e18731bfd39609914bd41e89b9b6d898fd3e (patch)
treea76ef054563479f9713c8fcaeda39bb740fd7570 /src/mesa/vbo
parent4df2931a87fe082f90871564a89a09c826641f5b (diff)
mesa/vbo: add KHR_no_error support to vbo_exec_DrawArrays*()
V2: add missing FLUSH_CURRENT() to no_error path Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/vbo')
-rw-r--r--src/mesa/vbo/vbo_exec_array.c49
1 files changed, 39 insertions, 10 deletions
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index ac27b49fcb5..7cc5288c6b4 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -625,8 +625,15 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count)
_mesa_debug(ctx, "glDrawArrays(%s, %d, %d)\n",
_mesa_enum_to_string(mode), start, count);
- if (!_mesa_validate_DrawArrays(ctx, mode, count))
- return;
+ if (_mesa_is_no_error_enabled(ctx)) {
+ FLUSH_CURRENT(ctx, 0);
+
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+ } else {
+ if (!_mesa_validate_DrawArrays(ctx, mode, count))
+ return;
+ }
if (0)
check_draw_arrays_data(ctx, start, count);
@@ -652,9 +659,17 @@ vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
_mesa_debug(ctx, "glDrawArraysInstanced(%s, %d, %d, %d)\n",
_mesa_enum_to_string(mode), start, count, numInstances);
- if (!_mesa_validate_DrawArraysInstanced(ctx, mode, start, count,
- numInstances))
- return;
+
+ if (_mesa_is_no_error_enabled(ctx)) {
+ FLUSH_CURRENT(ctx, 0);
+
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+ } else {
+ if (!_mesa_validate_DrawArraysInstanced(ctx, mode, start, count,
+ numInstances))
+ return;
+ }
if (0)
check_draw_arrays_data(ctx, start, count);
@@ -682,9 +697,16 @@ vbo_exec_DrawArraysInstancedBaseInstance(GLenum mode, GLint first,
_mesa_enum_to_string(mode), first, count,
numInstances, baseInstance);
- if (!_mesa_validate_DrawArraysInstanced(ctx, mode, first, count,
- numInstances))
- return;
+ if (_mesa_is_no_error_enabled(ctx)) {
+ FLUSH_CURRENT(ctx, 0);
+
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+ } else {
+ if (!_mesa_validate_DrawArraysInstanced(ctx, mode, first, count,
+ numInstances))
+ return;
+ }
if (0)
check_draw_arrays_data(ctx, first, count);
@@ -1567,8 +1589,15 @@ vbo_exec_DrawArraysIndirect(GLenum mode, const GLvoid *indirect)
_mesa_debug(ctx, "glDrawArraysIndirect(%s, %p)\n",
_mesa_enum_to_string(mode), indirect);
- if (!_mesa_validate_DrawArraysIndirect(ctx, mode, indirect))
- return;
+ if (_mesa_is_no_error_enabled(ctx)) {
+ FLUSH_CURRENT(ctx, 0);
+
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+ } else {
+ if (!_mesa_validate_DrawArraysIndirect(ctx, mode, indirect))
+ return;
+ }
if (skip_validated_draw(ctx))
return;