glsl_to_tgsi: use TGSI_OPCODE_CEIL for ir_unop_ceil
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Sat, 5 May 2012 12:38:09 +0000 (14:38 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Wed, 9 May 2012 15:13:14 +0000 (17:13 +0200)
The implementation using FLR was buggy, the second negation could
get lost.

src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index 9e68deb3471724874dbf6ffb55809237ae92afd1..eecabb3e666d86d9dcd1b1116ecfe0cb6b4af15b 100644 (file)
@@ -1775,9 +1775,7 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
       emit(ir, TGSI_OPCODE_TRUNC, result_dst, op[0]);
       break;
    case ir_unop_ceil:
-      op[0].negate = ~op[0].negate;
-      emit(ir, TGSI_OPCODE_FLR, result_dst, op[0]);
-      result_src.negate = ~result_src.negate;
+      emit(ir, TGSI_OPCODE_CEIL, result_dst, op[0]);
       break;
    case ir_unop_floor:
       emit(ir, TGSI_OPCODE_FLR, result_dst, op[0]);