[Mesa-dev] [PATCH 2/2] glsl_to_tgsi: use TGSI_OPCODE_CEIL for ir_unop_ceil
Christoph Bumiller
e0425955 at student.tuwien.ac.at
Sat May 5 05:41:55 PDT 2012
The implementation using FLR was buggy, the second negation could
get lost.
---
src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 9e68deb..eecabb3 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -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]);
--
1.7.3.4
More information about the mesa-dev
mailing list