summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-06-23 12:29:50 +1000
committerTimothy Arceri <[email protected]>2018-06-30 08:38:33 +1000
commit9b32c80357afe5a13e3fcf1e7e9e8a16518715f4 (patch)
tree15cc2a1bcd71c6b611feee0fc85c0bc9f8cf87b8 /src
parent03f1a2e8dfeae865286586f5569007a5d6b605e6 (diff)
mesa: generate GL_INVALID_OPERATION using draw indirect in dlist
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/dlist.c47
1 files changed, 47 insertions, 0 deletions
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);