summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-09-26 03:32:15 +0200
committerMarek Olšák <[email protected]>2017-10-06 02:56:11 +0200
commitbd1837471a99f8b3503633531ef78c3ea6bf2c85 (patch)
tree11f9152a25e45c4d43bbdec6b52964efdccff3e6
parentdbe16d75372cd94ec22ea588cb8bb2cb6d5f8766 (diff)
glsl_to_tgsi: enable copy propagation for tessellation shaders
just don't propagate output reads Reviewed-by: Nicolai Hähnle <[email protected]>
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 50a71e461f6..28899878bd0 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -4947,6 +4947,8 @@ glsl_to_tgsi_visitor::copy_propagate(void)
!inst->dst[0].reladdr2 &&
!inst->saturate &&
inst->src[0].file != PROGRAM_ARRAY &&
+ (inst->src[0].file != PROGRAM_OUTPUT ||
+ this->shader->Stage != MESA_SHADER_TESS_CTRL) &&
!inst->src[0].reladdr &&
!inst->src[0].reladdr2 &&
!inst->src[0].negate &&
@@ -6602,10 +6604,7 @@ get_mesa_program_tgsi(struct gl_context *ctx,
/* Perform optimizations on the instructions in the glsl_to_tgsi_visitor. */
v->simplify_cmp();
-
- if (shader->Stage != MESA_SHADER_TESS_CTRL &&
- shader->Stage != MESA_SHADER_TESS_EVAL)
- v->copy_propagate();
+ v->copy_propagate();
while (v->eliminate_dead_code());