glsl: Add a new ir_unop_round_even opcode for GLSL 1.30's roundEven.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 14 Oct 2010 20:37:03 +0000 (13:37 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 14 Oct 2010 22:59:47 +0000 (15:59 -0700)
Also, update ir_to_mesa's "1.30 is unsupported" case to "handle" it.

src/glsl/ir.cpp
src/glsl/ir.h
src/mesa/program/ir_to_mesa.cpp

index fd1c5d907186942faf5dc8753d34292162450aa3..87e78eee0561f4387bf817741432ff09d86da63e 100644 (file)
@@ -216,6 +216,7 @@ ir_expression::get_num_operands(ir_expression_operation op)
       1, /* ir_unop_ceil */
       1, /* ir_unop_floor */
       1, /* ir_unop_fract */
+      1, /* ir_unop_round_even */
 
       1, /* ir_unop_sin */
       1, /* ir_unop_cos */
@@ -288,6 +289,7 @@ static const char *const operator_strs[] = {
    "ceil",
    "floor",
    "fract",
+   "round_even",
    "sin",
    "cos",
    "dFdx",
index 3503bc9c8971e5d9ccb3af52d46a62cb173d5de2..06198e4f3f619a2f29cabc6623f1ebb4c9281aa3 100644 (file)
@@ -700,6 +700,7 @@ enum ir_expression_operation {
    ir_unop_ceil,
    ir_unop_floor,
    ir_unop_fract,
+   ir_unop_round_even,
    /*@}*/
 
    /**
index cd609653fb384ca563adc05984132f3535e006f1..524130ca59e2fb0210956ed74fcc456c358fe7d7 100644 (file)
@@ -1130,6 +1130,7 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
    case ir_binop_bit_and:
    case ir_binop_bit_xor:
    case ir_binop_bit_or:
+   case ir_unop_round_even:
       assert(!"GLSL 1.30 features unsupported");
       break;
    }