glsl_to_tgsi: enable copy propagation for tessellation shaders
authorMarek Olšák <marek.olsak@amd.com>
Tue, 26 Sep 2017 01:32:15 +0000 (03:32 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 6 Oct 2017 00:56:11 +0000 (02:56 +0200)
just don't propagate output reads

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index 50a71e461f62d74d5494cf6668307ba77c1264e7..28899878bd0deeb3a91546ca30e0e3a66a405b71 100644 (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());