summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/compute.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2016-09-07 21:52:08 +0200
committerSamuel Pitoiset <[email protected]>2016-10-07 00:18:57 +0200
commit45ab63c0cb274b20a7ae1f390b123e13a5b46c98 (patch)
tree9961670819d37c96c6da45262ab302bf4f19cb64 /src/mesa/main/compute.c
parenta063f3084acfaf9a63ab8af004d94c592b19b8a0 (diff)
mesa/main: add support for ARB_compute_variable_groups_size
v5: - replace fixed_local_size by !LocalSizeVariable (Nicolai) v4: - slightly indent spec quotes (Nicolai) - drop useless _mesa_has_compute_shaders() check (Nicolai) - move the fixed local size outside of the loop (Nicolai) - add missing check for invalid use of work group count v2: - update formatting spec quotations (Ian) - move the total_invocations check outside of the loop (Ian) Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/main/compute.c')
-rw-r--r--src/mesa/main/compute.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/main/compute.c b/src/mesa/main/compute.c
index b052bae7e91..bb6253906bc 100644
--- a/src/mesa/main/compute.c
+++ b/src/mesa/main/compute.c
@@ -66,5 +66,22 @@ _mesa_DispatchComputeGroupSizeARB(GLuint num_groups_x, GLuint num_groups_y,
GLuint num_groups_z, GLuint group_size_x,
GLuint group_size_y, GLuint group_size_z)
{
+ GET_CURRENT_CONTEXT(ctx);
+ const GLuint num_groups[3] = { num_groups_x, num_groups_y, num_groups_z };
+ const GLuint group_size[3] = { group_size_x, group_size_y, group_size_z };
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx,
+ "glDispatchComputeGroupSizeARB(%d, %d, %d, %d, %d, %d)\n",
+ num_groups_x, num_groups_y, num_groups_z,
+ group_size_x, group_size_y, group_size_z);
+
+ if (!_mesa_validate_DispatchComputeGroupSizeARB(ctx, num_groups,
+ group_size))
+ return;
+
+ if (num_groups_x == 0u || num_groups_y == 0u || num_groups_z == 0u)
+ return;
+ ctx->Driver.DispatchComputeGroupSize(ctx, num_groups, group_size);
}