diff --git a/src/compiler/glsl/ir.cpp b/src/compiler/glsl/ir.cpp index 08b62ddfafb..1d65cbcf7ad 100644 --- a/src/compiler/glsl/ir.cpp +++ b/src/compiler/glsl/ir.cpp @@ -2291,63 +2291,6 @@ reparent_ir(exec_list *list, void *mem_ctx) } } - -static ir_rvalue * -try_min_one(ir_rvalue *ir) -{ - ir_expression *expr = ir->as_expression(); - - if (!expr || expr->operation != ir_binop_min) - return NULL; - - if (expr->operands[0]->is_one()) - return expr->operands[1]; - - if (expr->operands[1]->is_one()) - return expr->operands[0]; - - return NULL; -} - -static ir_rvalue * -try_max_zero(ir_rvalue *ir) -{ - ir_expression *expr = ir->as_expression(); - - if (!expr || expr->operation != ir_binop_max) - return NULL; - - if (expr->operands[0]->is_zero()) - return expr->operands[1]; - - if (expr->operands[1]->is_zero()) - return expr->operands[0]; - - return NULL; -} - -ir_rvalue * -ir_rvalue::as_rvalue_to_saturate() -{ - ir_expression *expr = this->as_expression(); - - if (!expr) - return NULL; - - ir_rvalue *max_zero = try_max_zero(expr); - if (max_zero) { - return try_min_one(max_zero); - } else { - ir_rvalue *min_one = try_min_one(expr); - if (min_one) { - return try_max_zero(min_one); - } - } - - return NULL; -} - - unsigned vertices_per_prim(GLenum prim) { diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h index 792f40cd072..c1c5f36d86b 100644 --- a/src/compiler/glsl/ir.h +++ b/src/compiler/glsl/ir.h @@ -230,8 +230,6 @@ public: virtual ir_constant *constant_expression_value(void *mem_ctx, struct hash_table *variable_context = NULL); - ir_rvalue *as_rvalue_to_saturate(); - virtual bool is_lvalue(const struct _mesa_glsl_parse_state * = NULL) const { return false;