diff options
author | Ilia Mirkin <[email protected]> | 2015-06-27 17:38:57 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2015-07-03 08:56:09 -0400 |
commit | 0a155538eb7e7870b99fb8b3fd8e2a268361d2c8 (patch) | |
tree | 09d37d8988f338f01594a0b2a87f0727c586bdad /src/gallium/auxiliary/nir | |
parent | 959b47262b339ad6d1a072c17a1abe9735ead41d (diff) |
gallium/ttn: mark location specially in nir for color0-writes-all
We need to distinguish a shader that has separate writes to each MRT
from one which is supposed to write the data from MRT 0 to all the MRTs.
In TGSI this is done with a property. NIR doesn't have that, so encode
it as a funny location and decode on the other end.
Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/nir')
-rw-r--r-- | src/gallium/auxiliary/nir/tgsi_to_nir.c | 7 |
1 files changed, 6 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; |