[Mesa-dev] [PATCH] mesa: Don't call driver when there is no compute work

Ilia Mirkin imirkin at alum.mit.edu
Tue Feb 16 16:40:40 UTC 2016


Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

(somehow I was sure this was done already... but apparently not.)

On Tue, Feb 16, 2016 at 11:24 AM, Jordan Justen
<jordan.l.justen at intel.com> wrote:
> 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 at intel.com>
> ---
>  src/mesa/main/compute.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/mesa/main/compute.c b/src/mesa/main/compute.c
> index 53e7a50..b71430f 100644
> --- a/src/mesa/main/compute.c
> +++ b/src/mesa/main/compute.c
> @@ -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);
>  }
>
> --
> 2.7.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list