From: Alyssa Rosenzweig Date: Wed, 31 Jul 2019 22:20:00 +0000 (-0700) Subject: panfrost: Expose compute shaders as panfrost_shader_variants X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1b284628ef8bc3c0fa4513a1fe64b6ed556fd4b2;p=mesa.git panfrost: Expose compute shaders as panfrost_shader_variants Whether variants are packed by graphics or compute is irrelevant. Signed-off-by: Alyssa Rosenzweig --- diff --git a/src/gallium/drivers/panfrost/pan_compute.c b/src/gallium/drivers/panfrost/pan_compute.c index ee3aa5edb36..9da25874b5e 100644 --- a/src/gallium/drivers/panfrost/pan_compute.c +++ b/src/gallium/drivers/panfrost/pan_compute.c @@ -33,7 +33,11 @@ panfrost_create_compute_state( struct pipe_context *pctx, const struct pipe_compute_state *cso) { - return mem_dup(cso, sizeof(*cso)); + struct panfrost_shader_variants *so = CALLOC_STRUCT(panfrost_shader_variants); + so->cbase = *cso; + so->is_compute = true; + + return so; } static void diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h index f85d70a123d..64de9624f51 100644 --- a/src/gallium/drivers/panfrost/pan_context.h +++ b/src/gallium/drivers/panfrost/pan_context.h @@ -231,7 +231,15 @@ struct panfrost_shader_state { /* A collection of varyings (the CSO) */ struct panfrost_shader_variants { - struct pipe_shader_state base; + /* A panfrost_shader_variants can represent a shader for + * either graphics or compute */ + + bool is_compute; + + union { + struct pipe_shader_state base; + struct pipe_compute_state cbase; + }; struct panfrost_shader_state variants[MAX_SHADER_VARIANTS]; unsigned variant_count;