summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-06-28 10:25:17 +1000
committerTimothy Arceri <[email protected]>2018-06-30 08:38:33 +1000
commit03f1a2e8dfeae865286586f5569007a5d6b605e6 (patch)
treea172c491dd67e1ccb9dccf3b1b68f7964324b93e /src/mesa
parent87d609358388f9c63a80daffe2a5dc4daf650b66 (diff)
mesa: add missing display list support for ARB_compute_shader
The extension is enabled for compat profile but there is currently no display list support. I filed a spec bug and it has been agreed that glDispatchComputeIndirect should generate an INVALID_OPERATION error when called during display list compilation. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/dlist.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index b2b1f723a17..e2ab2eb8aa1 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -510,6 +510,9 @@ typedef enum
OPCODE_SAMPLER_PARAMETERIIV,
OPCODE_SAMPLER_PARAMETERUIV,
+ /* ARB_compute_shader */
+ OPCODE_DISPATCH_COMPUTE,
+
/* GL_ARB_sync */
OPCODE_WAIT_SYNC,
@@ -6571,6 +6574,33 @@ save_DrawTransformFeedbackStreamInstanced(GLenum mode, GLuint name,
}
static void GLAPIENTRY
+save_DispatchCompute(GLuint num_groups_x, GLuint num_groups_y,
+ GLuint num_groups_z)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_DISPATCH_COMPUTE, 3);
+ if (n) {
+ n[1].ui = num_groups_x;
+ n[2].ui = num_groups_y;
+ n[3].ui = num_groups_z;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_DispatchCompute(ctx->Exec, (num_groups_x, num_groups_y,
+ num_groups_z));
+ }
+}
+
+static void GLAPIENTRY
+save_DispatchComputeIndirect(GLintptr indirect)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glDispatchComputeIndirect() during display list compile");
+}
+
+static void GLAPIENTRY
save_UseProgram(GLuint program)
{
GET_CURRENT_CONTEXT(ctx);
@@ -10429,6 +10459,11 @@ execute_list(struct gl_context *ctx, GLuint list)
}
break;
+ /* ARB_compute_shader */
+ case OPCODE_DISPATCH_COMPUTE:
+ CALL_DispatchCompute(ctx->Exec, (n[1].ui, n[2].ui, n[3].ui));
+ break;
+
/* GL_ARB_sync */
case OPCODE_WAIT_SYNC:
{
@@ -11138,6 +11173,10 @@ _mesa_initialize_save_table(const struct gl_context *ctx)
SET_DepthRangeArrayv(table, save_DepthRangeArrayv);
SET_DepthRangeIndexed(table, save_DepthRangeIndexed);
+ /* 122. ARB_compute_shader */
+ SET_DispatchCompute(table, save_DispatchCompute);
+ SET_DispatchComputeIndirect(table, save_DispatchComputeIndirect);
+
/* 173. GL_EXT_blend_func_separate */
SET_BlendFuncSeparate(table, save_BlendFuncSeparateEXT);