glsl: fix conversions from uint to bool and from float/bool to uint
[mesa.git] / src / glsl / opt_dead_code_local.cpp
index 88dcdc25176602c4f65efcb5d15db2b132e0c2e3..39962bd602ef8ba89a2ad34eba903d82cdbdc437 100644 (file)
@@ -38,8 +38,6 @@
 #include "ir_optimization.h"
 #include "glsl_types.h"
 
-using std::printf;
-
 static bool debug = false;
 
 class assignment_entry : public exec_node
@@ -131,15 +129,8 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments)
    var = ir->lhs->variable_referenced();
    assert(var);
 
-   bool always_assign = true;
-   if (ir->condition) {
-      ir_constant *condition = ir->condition->as_constant();
-      if (!condition || !condition->value.b[0])
-        always_assign = false;
-   }
-
    /* Now, check if we did a whole-variable assignment. */
-   if (always_assign && (ir->whole_variable_written() != NULL)) {
+   if (!ir->condition && (ir->whole_variable_written() != NULL)) {
       /* We did a whole-variable assignment.  So, any instruction in
        * the assignment list with the same LHS is dead.
        */