[Mesa-dev] [PATCH 1/2] mesa: move glMultiDrawArray to vbo and fix error handling

Ilia Mirkin imirkin at alum.mit.edu
Fri Apr 7 16:34:08 UTC 2017


On Fri, Apr 7, 2017 at 12:30 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> When any count[i] is negative, we must skip all draws.
>
> Moving to vbo makes the subsequent change easier.
> ---
>  src/mapi/glapi/gen/gl_API.xml |  2 +-
>  src/mesa/main/api_validate.c  | 38 ++++++++++++++++++++++++++++++++++++++
>  src/mesa/main/api_validate.h  |  4 ++++
>  src/mesa/main/varray.c        | 18 ------------------
>  src/mesa/vbo/vbo_exec_array.c | 33 +++++++++++++++++++++++++++++++++
>  src/mesa/vbo/vbo_save_api.c   | 35 +++++++++++++++++++++++++++++++++++
>  6 files changed, 111 insertions(+), 19 deletions(-)
>
> diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
> index 30c52d5..bc4a18f 100644
> --- a/src/mesa/vbo/vbo_exec_array.c
> +++ b/src/mesa/vbo/vbo_exec_array.c
> @@ -1685,20 +1717,21 @@ vbo_initialize_exec_dispatch(const struct gl_context *ctx,
>        SET_MultiDrawElementsIndirectCountARB(exec,
>                                              vbo_exec_MultiDrawElementsIndirectCount);
>     }
>
>     if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
>        SET_DrawArraysInstancedARB(exec, vbo_exec_DrawArraysInstanced);
>        SET_DrawElementsInstancedARB(exec, vbo_exec_DrawElementsInstanced);
>     }
>
>     if (_mesa_is_desktop_gl(ctx)) {
> +      SET_MultiDrawArrays(exec, vbo_exec_MultiDrawArrays);

Shouldn't this be for ES as well? EXT_multi_draw_arrays is defined for
ES1/ES2, and we support it...

>        SET_DrawTransformFeedback(exec, vbo_exec_DrawTransformFeedback);
>        SET_DrawTransformFeedbackStream(exec,
>                                        vbo_exec_DrawTransformFeedbackStream);
>        SET_DrawTransformFeedbackInstanced(exec,
>                                           vbo_exec_DrawTransformFeedbackInstanced);
>        SET_DrawTransformFeedbackStreamInstanced(exec,
>                                                 vbo_exec_DrawTransformFeedbackStreamInstanced);
>     }
>  }
>


More information about the mesa-dev mailing list