On 03.10.2017 17:46, Marek Olšák wrote:
On Mon, Oct 2, 2017 at 12:55 PM, Nicolai Hähnle <[email protected]> wrote:
On 29.09.2017 14:25, Marek Olšák wrote:

From: Marek Olšák <[email protected]>

just don't propagate output reads
---
   src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 6 ++----
   1 file changed, 2 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 50a71e4..2d62213 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -4940,20 +4940,21 @@ glsl_to_tgsi_visitor::copy_propagate(void)
           /* If this is a copy, add it to the ACP. */
         if (inst->op == TGSI_OPCODE_MOV &&
             inst->dst[0].file == PROGRAM_TEMPORARY &&
             !(inst->dst[0].file == inst->src[0].file &&
                inst->dst[0].index == inst->src[0].index) &&
             !inst->dst[0].reladdr &&
             !inst->dst[0].reladdr2 &&
             !inst->saturate &&
             inst->src[0].file != PROGRAM_ARRAY &&
+          inst->src[0].file != PROGRAM_OUTPUT &&


Did you check shader-db effects of this? We only really need this
restriction on TCS. Though I guess radeonsi is actually one of the least
affected drivers thanks to LLVM.

No shader-db change, but I can add this:

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 9ddfb1e..1253f88 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -4970,7 +4970,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].file != PROGRAM_OUTPUT) &&
            !inst->src[0].reladdr &&
            !inst->src[0].reladdr2 &&
            !inst->src[0].negate &&

That looks good, thanks!




Marek



--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to