diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-07-31 15:20:00 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-08-01 16:23:03 -0700 |
commit | 1b284628ef8bc3c0fa4513a1fe64b6ed556fd4b2 (patch) | |
tree | 994c2980cb9f0a2e3cb38996000b1a63e7a29ca3 /src/gallium/drivers | |
parent | 8b53230d47e2287376fd407bb08eb993af7d47ad (diff) |
panfrost: Expose compute shaders as panfrost_shader_variants
Whether variants are packed by graphics or compute is irrelevant.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_compute.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_context.h | 10 |
2 files changed, 14 insertions, 2 deletions
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; |