glsl: Remove extra checks for constant true assignment conditions.

These are already stripped by opt_constant_folding.cpp.
This commit is contained in:
Eric Anholt
2011-01-30 07:59:14 +10:00
parent b6d49ab843
commit 29a2e9133e
5 changed files with 9 additions and 28 deletions

View File

@@ -131,15 +131,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.
*/