[Mesa-dev] [PATCH 15/23] radeonsi: do not export VS outputs from vertex streams != 0

Nicolai Hähnle nhaehnle at gmail.com
Wed Nov 30 13:35:17 UTC 2016


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

This affects for GS copy shaders. When an output is meant for vertex
stream != 0, then we don't have to make it available to the pixel
shader.

There is a minor inefficiency here because the GLSL varying packing pass
does not group varyings of the same vertex stream together, but it
shouldn't be important in practice.
---
 src/gallium/drivers/radeonsi/si_shader.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index cd2fd09..b2cf44a 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -2298,20 +2298,26 @@ static void si_llvm_export_vs(struct lp_build_tgsi_context *bld_base,
 			    (1ull << si_shader_io_get_unique_index(semantic_name, semantic_index)))
 				export_param = false;
 			break;
 		default:
 			if (shader->key.opt.hw_vs.kill_outputs2 &
 			    (1u << si_shader_io_get_unique_index2(semantic_name, semantic_index)))
 				export_param = false;
 			break;
 		}
 
+		if (outputs[i].vertex_stream[0] != 0 &&
+		    outputs[i].vertex_stream[1] != 0 &&
+		    outputs[i].vertex_stream[2] != 0 &&
+		    outputs[i].vertex_stream[3] != 0)
+			export_param = false;
+
 handle_semantic:
 		/* Select the correct target */
 		switch(semantic_name) {
 		case TGSI_SEMANTIC_PSIZE:
 			psize_value = outputs[i].values[0];
 			continue;
 		case TGSI_SEMANTIC_EDGEFLAG:
 			edgeflag_value = outputs[i].values[0];
 			continue;
 		case TGSI_SEMANTIC_LAYER:
-- 
2.7.4



More information about the mesa-dev mailing list