From 9b32c80357afe5a13e3fcf1e7e9e8a16518715f4 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Sat, 23 Jun 2018 12:29:50 +1000 Subject: [PATCH] mesa: generate GL_INVALID_OPERATION using draw indirect in dlist MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. Reviewed-by: Marek Olšák --- 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.30.2