st/mesa: keep track of saturated writes when eliminating dead code
authorIlia Mirkin <imirkin@alum.mit.edu>
Wed, 23 Sep 2015 04:30:23 +0000 (00:30 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 24 Sep 2015 04:19:55 +0000 (00:19 -0400)
It doesn't matter whether a write is saturated or not, in another
implementation it might even have been a separate opcode. This code was
most likely copied from the copy-propagation pass (where one does have
to distinguish saturation).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index c3a8c119b1ec438316f663e1fcfe4bfbf2ad1054..5896f6518b50b54df3ab89270a1dc15b36499b07 100644 (file)
@@ -4144,8 +4144,7 @@ glsl_to_tgsi_visitor::eliminate_dead_code(void)
        */
       for (unsigned i = 0; i < ARRAY_SIZE(inst->dst); i++) {
          if (inst->dst[i].file == PROGRAM_TEMPORARY &&
-             !inst->dst[i].reladdr &&
-             !inst->saturate) {
+             !inst->dst[i].reladdr) {
             for (int c = 0; c < 4; c++) {
                if (inst->dst[i].writemask & (1 << c)) {
                   if (writes[4 * inst->dst[i].index + c]) {