r300/compiler: Use ALU Result for IF conditionals
[mesa.git] / src / mesa / drivers / dri / r300 / compiler / radeon_optimize.c
index 53ab5fbbbd9bb12ba9a9127747ce9441d4b27c7c..ac73608839e4dfb66a47d0de5eb0356952804ebe 100644 (file)
@@ -517,8 +517,11 @@ static int is_presub_candidate(
 
        assert(inst->U.I.Opcode == RC_OPCODE_ADD);
 
-       if (inst->U.I.PreSub.Opcode != RC_PRESUB_NONE || inst->U.I.SaturateMode)
+       if (inst->U.I.PreSub.Opcode != RC_PRESUB_NONE
+                       || inst->U.I.SaturateMode
+                       || inst->U.I.WriteALUResult) {
                return 0;
+       }
 
        /* If both sources use a constant swizzle, then we can't convert it to
         * a presubtract operation.  In fact for the ADD and SUB presubtract