From: Timothy Arceri Date: Fri, 9 Feb 2018 09:34:53 +0000 (+1100) Subject: radeonsi/nir: add FRAG_RESULT_COLOR to scan pass X-Git-Tag: upstream/18.1.0~1814 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6a8efbe652c328c2367476069ff1435c358e6f78;p=platform%2Fupstream%2Fmesa.git radeonsi/nir: add FRAG_RESULT_COLOR to scan pass Fixes a number of draw buffers piglit tests. Reviewed-by: Samuel Pitoiset --- diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index dd1de6c..04d0738 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;