[Mesa-dev] [PATCH 12/14] mesa/vbo: add KHR_no_error support to vbo_exec_DrawArrays*()

Nicolai Hähnle nhaehnle at gmail.com
Thu Apr 13 19:34:45 UTC 2017


On second thought, there are a bunch of things that I think need to be 
answered here:

On 13.04.2017 01:42, Timothy Arceri wrote:
> ---
>  src/mesa/vbo/vbo_exec_array.c | 41 +++++++++++++++++++++++++++++++----------
>  1 file changed, 31 insertions(+), 10 deletions(-)
>
> diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
> index 9452c65..6e3cd5a 100644
> --- a/src/mesa/vbo/vbo_exec_array.c
> +++ b/src/mesa/vbo/vbo_exec_array.c
> @@ -616,22 +616,27 @@ vbo_exec_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
>   */
>  static void GLAPIENTRY
>  vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count)
>  {
>     GET_CURRENT_CONTEXT(ctx);
>
>     if (MESA_VERBOSE & VERBOSE_DRAW)
>        _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)) {
> +      if (ctx->NewState)
> +         _mesa_update_state(ctx);

Why the call(s) to _mesa_update_state? The validate functions don't do that.

Conversely, all the validate functions call FLUSH_CURRENT, which the 
no_error path now doesn't do anymore -- that seems wrong.

Nicolai

> +   } else {
> +      if (!_mesa_validate_DrawArrays(ctx, mode, count))
> +         return;
> +   }
>
>     if (0)
>        check_draw_arrays_data(ctx, start, count);
>
>     vbo_draw_arrays(ctx, mode, start, count, 1, 0);
>
>     if (0)
>        print_draw_arrays(ctx, mode, start, count);
>  }
>
> @@ -643,23 +648,29 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count)
>  static void GLAPIENTRY
>  vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
>                               GLsizei numInstances)
>  {
>     GET_CURRENT_CONTEXT(ctx);
>
>     if (MESA_VERBOSE & VERBOSE_DRAW)
>        _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)) {
> +      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);
>
>     vbo_draw_arrays(ctx, mode, start, count, numInstances, 0);
>
>     if (0)
>        print_draw_arrays(ctx, mode, start, count);
>  }
>
> @@ -673,23 +684,28 @@ vbo_exec_DrawArraysInstancedBaseInstance(GLenum mode, GLint first,
>                                           GLuint baseInstance)
>  {
>     GET_CURRENT_CONTEXT(ctx);
>
>     if (MESA_VERBOSE & VERBOSE_DRAW)
>        _mesa_debug(ctx,
>                    "glDrawArraysInstancedBaseInstance(%s, %d, %d, %d, %d)\n",
>                    _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)) {
> +      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);
>
>     vbo_draw_arrays(ctx, mode, first, count, numInstances, baseInstance);
>
>     if (0)
>        print_draw_arrays(ctx, mode, first, count);
>  }
>
> @@ -1519,22 +1535,27 @@ vbo_validated_multidrawelementsindirect(struct gl_context *ctx,
>   */
>  static void GLAPIENTRY
>  vbo_exec_DrawArraysIndirect(GLenum mode, const GLvoid *indirect)
>  {
>     GET_CURRENT_CONTEXT(ctx);
>
>     if (MESA_VERBOSE & VERBOSE_DRAW)
>        _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)) {
> +      if (ctx->NewState)
> +         _mesa_update_state(ctx);
> +   } else {
> +      if (!_mesa_validate_DrawArraysIndirect(ctx, mode, indirect))
> +         return;
> +   }
>
>     if (skip_validated_draw(ctx))
>        return;
>
>     vbo_validated_drawarraysindirect(ctx, mode, indirect);
>  }
>
>
>  static void GLAPIENTRY
>  vbo_exec_DrawElementsIndirect(GLenum mode, GLenum type, const GLvoid *indirect)
>


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.


More information about the mesa-dev mailing list