summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/opt_algebraic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/glsl/opt_algebraic.cpp')
-rw-r--r--src/compiler/glsl/opt_algebraic.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/compiler/glsl/opt_algebraic.cpp b/src/compiler/glsl/opt_algebraic.cpp
index 3662e8b2699..a5ba843fd15 100644
--- a/src/compiler/glsl/opt_algebraic.cpp
+++ b/src/compiler/glsl/opt_algebraic.cpp
@@ -144,7 +144,7 @@ is_valid_vec_const(ir_constant *ir)
static inline bool
is_less_than_one(ir_constant *ir)
{
- assert(ir->type->base_type == GLSL_TYPE_FLOAT);
+ assert(ir->type->is_float());
if (!is_valid_vec_const(ir))
return false;
@@ -161,7 +161,7 @@ is_less_than_one(ir_constant *ir)
static inline bool
is_greater_than_zero(ir_constant *ir)
{
- assert(ir->type->base_type == GLSL_TYPE_FLOAT);
+ assert(ir->type->is_float());
if (!is_valid_vec_const(ir))
return false;
@@ -649,8 +649,7 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
case ir_binop_div:
if (is_vec_one(op_const[0]) && (
- ir->type->base_type == GLSL_TYPE_FLOAT ||
- ir->type->is_double())) {
+ ir->type->is_float() || ir->type->is_double())) {
return new(mem_ctx) ir_expression(ir_unop_rcp,
ir->operands[1]->type,
ir->operands[1],
@@ -845,7 +844,7 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
case ir_binop_min:
case ir_binop_max:
- if (ir->type->base_type != GLSL_TYPE_FLOAT || options->EmitNoSat)
+ if (!ir->type->is_float() || options->EmitNoSat)
break;
/* Replace min(max) operations and its commutative combinations with