diff options
-rw-r--r-- | src/gallium/auxiliary/nir/tgsi_to_nir.c | 7 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/vc4/vc4_program.c | 6 |
3 files changed, 16 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c index bf7eb2fde02..4130697e2a7 100644 --- a/src/gallium/auxiliary/nir/tgsi_to_nir.c +++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c @@ -253,7 +253,12 @@ ttn_emit_declaration(struct ttn_compile *c) var->name = ralloc_asprintf(var, "out_%d", idx); var->data.location = decl->Semantic.Name; - var->data.index = decl->Semantic.Index; + if (decl->Semantic.Name == TGSI_SEMANTIC_COLOR && + decl->Semantic.Index == 0 && + c->scan->properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS]) + var->data.index = -1; + else + var->data.index = decl->Semantic.Index; if (is_array) { unsigned j; diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c index 3b36114a5ba..fa13c4076dc 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c @@ -2110,6 +2110,10 @@ setup_output(struct ir3_compile *ctx, nir_variable *out) so->writes_pos = true; break; case TGSI_SEMANTIC_COLOR: + if (semantic_index == -1) { + semantic_index = 0; + so->color0_mrt = 1; + } break; default: compile_error(ctx, "unknown FS semantic name: %s\n", diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c index 7b39a03f01a..a7aa3172a75 100644 --- a/src/gallium/drivers/vc4/vc4_program.c +++ b/src/gallium/drivers/vc4/vc4_program.c @@ -1783,6 +1783,12 @@ ntq_setup_outputs(struct vc4_compile *c) assert(array_len == 1); + /* NIR hack to pass through + * TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS */ + if (semantic_name == TGSI_SEMANTIC_COLOR && + semantic_index == -1) + semantic_index = 0; + for (int i = 0; i < 4; i++) { add_output(c, loc + i, |