r300/compiler: Don't use presubtract in TEX instructions
authorTom Stellard <tstellar@gmail.com>
Thu, 9 Sep 2010 17:19:52 +0000 (10:19 -0700)
committerTom Stellard <tstellar@gmail.com>
Sat, 11 Sep 2010 01:18:10 +0000 (18:18 -0700)
src/mesa/drivers/dri/r300/compiler/radeon_optimize.c

index 88aac949a10b1047c5f6c3d8cc535f970dccfc6a..0c6b1bd720a04c7959eeb185fbda3f15b0f44193 100644 (file)
@@ -192,7 +192,7 @@ static void copy_propagate(struct radeon_compiler * c, struct rc_instruction * i
                /* It is possible to do copy propigation in this situation,
                 * just not right now, see peephole_add_presub_inv() */
                if (inst_mov->U.I.PreSub.Opcode != RC_PRESUB_NONE &&
-                                               info->NumSrcRegs > 2) {
+                               (info->NumSrcRegs > 2 || info->HasTexture)) {
                        return;
                }
 
@@ -559,6 +559,11 @@ static int presub_helper(
                                break;
                        }
 
+                       if (info->HasTexture) {
+                               can_remove = 0;
+                               break;
+                       }
+
                        /* We can't use more than one presubtract value in an
                         * instruction, unless the two prsubtract operations
                         * are the same and read from the same registers. */