radeonsi: Change default behaviour for undefined COLOR0
authorAxel Davy <axel.davy@ens.fr>
Sat, 19 Mar 2016 18:57:00 +0000 (19:57 +0100)
committerAxel Davy <axel.davy@ens.fr>
Wed, 18 May 2016 21:37:14 +0000 (23:37 +0200)
d3d 9 needs COLOR0 to be 1.0 on all channels when
undefined. 0.0 for the others is fine.
GL behaviour is undefined.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_state_shaders.c

index 11e73098253ae9421ae278f94d730a3239252644..13066ff3c7dffdf583291409da6294419ce1a2cc 100644 (file)
@@ -1406,6 +1406,9 @@ static unsigned si_get_ps_input_cntl(struct si_context *sctx,
                 * Don't set any other bits.
                 * (FLAT_SHADE=1 completely changes behavior) */
                ps_input_cntl = S_028644_OFFSET(0x20);
+               /* D3D 9 behaviour. GL is undefined */
+               if (name == TGSI_SEMANTIC_COLOR && index == 0)
+                       ps_input_cntl |= S_028644_DEFAULT_VAL(3);
        }
        return ps_input_cntl;
 }