lima/ppir: lower selects to scalars
authorErico Nunes <nunes.erico@gmail.com>
Sat, 10 Aug 2019 20:44:22 +0000 (22:44 +0200)
committerErico Nunes <nunes.erico@gmail.com>
Sun, 25 Aug 2019 18:29:12 +0000 (18:29 +0000)
nir vec4 fcsel assumes that each component of the condition will be used
to select the same component from the options, but pp can't implement
that since it only has 1 component for the condition.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
src/gallium/drivers/lima/lima_program.c

index 845d9535aacebcae1b4156899308284e57705947..cb05c6f379f2dab9ec0ddb13a87f029318162657 100644 (file)
@@ -158,6 +158,11 @@ lima_program_optimize_fs_nir(struct nir_shader *s)
    BITSET_SET(alu_lower, nir_op_fsqrt);
    BITSET_SET(alu_lower, nir_op_fsin);
    BITSET_SET(alu_lower, nir_op_fcos);
+   /* nir vec4 fcsel assumes that each component of the condition will be
+    * used to select the same component from the two options, but lima
+    * can't implement that since we only have 1 component condition */
+   BITSET_SET(alu_lower, nir_op_fcsel);
+   BITSET_SET(alu_lower, nir_op_bcsel);
 
    NIR_PASS_V(s, nir_lower_fragcoord_wtrans);
    NIR_PASS_V(s, nir_lower_io, nir_var_all, type_size, 0);