glsl_to_tgsi: enable copy propagation for tessellation shaders

just don't propagate output reads

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
Marek Olšák 2017-09-26 03:32:15 +02:00
parent dbe16d7537
commit bd1837471a
1 changed files with 3 additions and 4 deletions

View File

@ -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());