Mesa (master): glsl: Simplify a type check by using type->is_integer().

Ian Romanick idr at kemper.freedesktop.org
Fri Nov 19 23:58:46 UTC 2010


Module: Mesa
Branch: master
Commit: b943fb94bf50f20b773dc63558feb6b9480b8a28
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b943fb94bf50f20b773dc63558feb6b9480b8a28

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Thu Nov 18 17:15:13 2010 -0800

glsl: Simplify a type check by using type->is_integer().

---

 src/glsl/lower_div_to_mul_rcp.cpp |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/glsl/lower_div_to_mul_rcp.cpp b/src/glsl/lower_div_to_mul_rcp.cpp
index d34c4bc..db9d685 100644
--- a/src/glsl/lower_div_to_mul_rcp.cpp
+++ b/src/glsl/lower_div_to_mul_rcp.cpp
@@ -62,8 +62,7 @@ ir_div_to_mul_rcp_visitor::visit_leave(ir_expression *ir)
    if (ir->operation != ir_binop_div)
       return visit_continue;
 
-   if (ir->operands[1]->type->base_type != GLSL_TYPE_INT &&
-       ir->operands[1]->type->base_type != GLSL_TYPE_UINT) {
+   if (!ir->operands[1]->type->is_integer()) {
       /* New expression for the 1.0 / op1 */
       ir_rvalue *expr;
       expr = new(ir) ir_expression(ir_unop_rcp,




More information about the mesa-commit mailing list