summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRob Clark <robclark@freedesktop.org>2014-10-03 10:08:59 -0400
committerEmil Velikov <emil.l.velikov@gmail.com>2014-10-29 17:44:22 +0000
commitbce2d42ddb65ccb41a50c83e86f14df899e56a4c (patch)
tree4d191faf637239e2869dfc4c5e68707128709fd2 /src
parent7e81f4a7e7b7d6c5d2f6f8fdd2c4735a1622c80e (diff)
freedreno/a3xx: handle VS only outputting BCOLOR
Possibly we should map the front color to black (zeroes). But not sure there is a way to do that without generating a shader variant. Signed-off-by: Rob Clark <robclark@freedesktop.org> (cherry picked from commit a262c601d363aea2e6680df527e207cc9d5e235f)
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/freedreno/a3xx/fd3_program.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_program.c b/src/gallium/drivers/freedreno/a3xx/fd3_program.c
index d2a32486781..64c9668129b 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_program.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_program.c
@@ -140,13 +140,21 @@ find_output(const struct ir3_shader_variant *so, ir3_semantic semantic)
* in the vertex shader.. but the fragment shader doesn't know this
* so it will always have both IN.COLOR[n] and IN.BCOLOR[n]. So
* at link time if there is no matching OUT.BCOLOR[n], we must map
- * OUT.COLOR[n] to IN.BCOLOR[n].
+ * OUT.COLOR[n] to IN.BCOLOR[n]. And visa versa if there is only
+ * a OUT.BCOLOR[n] but no matching OUT.COLOR[n]
*/
if (sem2name(semantic) == TGSI_SEMANTIC_BCOLOR) {
unsigned idx = sem2idx(semantic);
- return find_output(so, ir3_semantic_name(TGSI_SEMANTIC_COLOR, idx));
+ semantic = ir3_semantic_name(TGSI_SEMANTIC_COLOR, idx);
+ } else if (sem2name(semantic) == TGSI_SEMANTIC_COLOR) {
+ unsigned idx = sem2idx(semantic);
+ semantic = ir3_semantic_name(TGSI_SEMANTIC_BCOLOR, idx);
}
+ for (j = 0; j < so->outputs_count; j++)
+ if (so->outputs[j].semantic == semantic)
+ return j;
+
debug_assert(0);
return 0;