mesa: Don't call driver when there is no compute work
authorJordan Justen <jordan.l.justen@intel.com>
Tue, 16 Feb 2016 16:21:22 +0000 (08:21 -0800)
committerJordan Justen <jordan.l.justen@intel.com>
Tue, 16 Feb 2016 17:25:20 +0000 (09:25 -0800)
The ARB_compute_shader spec says:

  "If the work group count in any dimension is zero, no work groups
   are dispatched."

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/mesa/main/compute.c

index 53e7a500f6136c51b74dbfd517111be8b134ef9c..b71430f2b12ac150a9cc79f6f4c915964eb77f95 100644 (file)
@@ -41,6 +41,9 @@ _mesa_DispatchCompute(GLuint num_groups_x,
    if (!_mesa_validate_DispatchCompute(ctx, num_groups))
       return;
 
+   if (num_groups_x == 0u || num_groups_y == 0u || num_groups_z == 0u)
+       return;
+
    ctx->Driver.DispatchCompute(ctx, num_groups);
 }