[Mesa-dev] [PATCH] radeonsi/nir: add FRAG_RESULT_COLOR to scan pass

Timothy Arceri tarceri at itsqueeze.com
Fri Feb 9 09:49:59 UTC 2018


Fixes a numer of draw buffers piglit tests.
---
 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 4eda3f3c18..d42ed5edcc 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 & ((uint64_t)1 << loc)) {
+			info->properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS] = true;
+		}
 	}
 
 	info->num_outputs = num_outputs;
-- 
2.14.3



More information about the mesa-dev mailing list