summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/opt_algebraic.cpp
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-04-21 11:18:50 +0200
committerSamuel Pitoiset <[email protected]>2017-04-21 19:34:15 +0200
commita7bc51aef8ef7e3374e034bfbe33096e985ffb0b (patch)
treed37cd02757c0c56cf0928a871123b631be4a2017 /src/compiler/glsl/opt_algebraic.cpp
parentcacc823c39044307e6befe12c3f51317f09973e2 (diff)
glsl: make use of glsl_type::is_float()
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
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