summaryrefslogtreecommitdiffstats
path: root/src/freedreno/ir3/ir3_shader.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/freedreno/ir3/ir3_shader.c')
-rw-r--r--src/freedreno/ir3/ir3_shader.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/freedreno/ir3/ir3_shader.c b/src/freedreno/ir3/ir3_shader.c
index 7c686f0ee2a..aae7baeb2e0 100644
--- a/src/freedreno/ir3/ir3_shader.c
+++ b/src/freedreno/ir3/ir3_shader.c
@@ -178,9 +178,14 @@ assemble_variant(struct ir3_shader_variant *v)
v->ir = NULL;
}
+/*
+ * For creating normal shader variants, 'nonbinning' is NULL. For
+ * creating binning pass shader, it is link to corresponding normal
+ * (non-binning) variant.
+ */
static struct ir3_shader_variant *
create_variant(struct ir3_shader *shader, struct ir3_shader_key *key,
- bool binning_pass)
+ struct ir3_shader_variant *nonbinning)
{
struct ir3_shader_variant *v = CALLOC_STRUCT(ir3_shader_variant);
int ret;
@@ -190,7 +195,8 @@ create_variant(struct ir3_shader *shader, struct ir3_shader_key *key,
v->id = ++shader->variant_count;
v->shader = shader;
- v->binning_pass = binning_pass;
+ v->binning_pass = !!nonbinning;
+ v->nonbinning = nonbinning;
v->key = *key;
v->type = shader->type;
@@ -226,7 +232,7 @@ shader_variant(struct ir3_shader *shader, struct ir3_shader_key *key,
return v;
/* compile new variant if it doesn't exist already: */
- v = create_variant(shader, key, false);
+ v = create_variant(shader, key, NULL);
if (v) {
v->next = shader->variants;
shader->variants = v;
@@ -246,7 +252,7 @@ ir3_shader_get_variant(struct ir3_shader *shader, struct ir3_shader_key *key,
if (v && binning_pass) {
if (!v->binning) {
- v->binning = create_variant(shader, key, true);
+ v->binning = create_variant(shader, key, v);
*created = true;
}
mtx_unlock(&shader->variants_lock);