[Mesa-dev] [PATCH 11/18] mesa: generate GL_INVALID_OPERATION using draw indirect in dlist

Marek Olšák maraeo at gmail.com
Fri Jun 29 05:23:10 UTC 2018


For patches 1-11:

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Thu, Jun 28, 2018 at 2:46 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> The spec doesn't explicitly say to generate an error but since
> DrawArraysInstanced* and DrawElementsInstanced* do, it makes
> sense to do it for these functions also.
> ---
>  src/mesa/main/dlist.c | 47 +++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 47 insertions(+)
>
> diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
> index e2ab2eb8aa1..5ff0a23018c 100644
> --- a/src/mesa/main/dlist.c
> +++ b/src/mesa/main/dlist.c
> @@ -1913,6 +1913,47 @@ save_DrawElementsInstancedBaseVertexBaseInstance(UNUSED GLenum mode,
>                 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
>  }
>
> +static void APIENTRY
> +save_DrawArraysIndirect(UNUSED GLenum mode,
> +                        UNUSED const void *indirect)
> +{
> +   GET_CURRENT_CONTEXT(ctx);
> +   _mesa_error(ctx, GL_INVALID_OPERATION,
> +               "glDrawArraysIndirect() during display list compile");
> +}
> +
> +static void APIENTRY
> +save_DrawElementsIndirect(UNUSED GLenum mode,
> +                          UNUSED GLenum type,
> +                          UNUSED const void *indirect)
> +{
> +   GET_CURRENT_CONTEXT(ctx);
> +   _mesa_error(ctx, GL_INVALID_OPERATION,
> +               "glDrawElementsIndirect() during display list compile");
> +}
> +
> +static void APIENTRY
> +save_MultiDrawArraysIndirect(UNUSED GLenum mode,
> +                             UNUSED const void *indirect,
> +                             UNUSED GLsizei primcount,
> +                             UNUSED GLsizei stride)
> +{
> +   GET_CURRENT_CONTEXT(ctx);
> +   _mesa_error(ctx, GL_INVALID_OPERATION,
> +               "glMultiDrawArraysIndirect() during display list compile");
> +}
> +
> +static void APIENTRY
> +save_MultiDrawElementsIndirect(UNUSED GLenum mode,
> +                               UNUSED GLenum type,
> +                               UNUSED const void *indirect,
> +                               UNUSED GLsizei primcount,
> +                               UNUSED GLsizei stride)
> +{
> +   GET_CURRENT_CONTEXT(ctx);
> +   _mesa_error(ctx, GL_INVALID_OPERATION,
> +               "glMultiDrawElementsIndirect() during display list compile");
> +}
>
>  /**
>   * While building a display list we cache some OpenGL state.
> @@ -11410,6 +11451,12 @@ _mesa_initialize_save_table(const struct gl_context *ctx)
>     SET_DrawElementsInstancedBaseInstance(table, save_DrawElementsInstancedBaseInstance);
>     SET_DrawElementsInstancedBaseVertexBaseInstance(table, save_DrawElementsInstancedBaseVertexBaseInstance);
>
> +   /* GL_ARB_draw_indirect / GL_ARB_multi_draw_indirect */
> +   SET_DrawArraysIndirect(table, save_DrawArraysIndirect);
> +   SET_DrawElementsIndirect(table, save_DrawElementsIndirect);
> +   SET_MultiDrawArraysIndirect(table, save_MultiDrawArraysIndirect);
> +   SET_MultiDrawElementsIndirect(table, save_MultiDrawElementsIndirect);
> +
>     /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
>     SET_UseProgramStages(table, save_UseProgramStages);
>     SET_ProgramUniform1f(table, save_ProgramUniform1f);
> --
> 2.17.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list