Whether variants are packed by graphics or compute is irrelevant.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
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
/* 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;