From 6a8efbe652c328c2367476069ff1435c358e6f78 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Fri, 9 Feb 2018 20:34:53 +1100 Subject: [PATCH] radeonsi/nir: add FRAG_RESULT_COLOR to scan pass Fixes a number of draw buffers piglit tests. Reviewed-by: Samuel Pitoiset --- src/gallium/drivers/radeonsi/si_shader_nir.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index dd1de6c851b..04d07381f5d 100644 --- a/src/gallium/drivers/radeonsi/si_shader_nir.c +++ b/src/gallium/drivers/radeonsi/si_shader_nir.c @@ -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; -- 2.30.2