From: Nicolai Hähnle <nicolai.haeh...@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

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to