radeonsi/nir: add FRAG_RESULT_COLOR to scan pass
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 9 Feb 2018 09:34:53 +0000 (20:34 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Fri, 9 Feb 2018 23:46:28 +0000 (10:46 +1100)
Fixes a number of draw buffers piglit tests.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/gallium/drivers/radeonsi/si_shader_nir.c

index dd1de6c851ba4837f9f78437259acb633985cba1..04d07381f5dd9434a11028e55eab28f4283882b8 100644 (file)
@@ -517,6 +517,12 @@ void si_nir_scan_shader(const struct nir_shader *nir,
                                info->reads_pervertex_outputs = true;
                        }
                }
+
+               unsigned loc = variable->data.location;
+               if (loc == FRAG_RESULT_COLOR &&
+                   nir->info.outputs_written & (1ull << loc)) {
+                       info->properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS] = true;
+               }
        }
 
        info->num_outputs = num_outputs;