glsl: Use ir_unop_f2u to convert floats to uints.
authorPaul Berry <stereotype441@gmail.com>
Wed, 13 Jun 2012 22:50:23 +0000 (15:50 -0700)
committerPaul Berry <stereotype441@gmail.com>
Fri, 15 Jun 2012 15:58:55 +0000 (08:58 -0700)
Fixes piglit tests
spec/glsl-1.30/execution/{vs,fs}-float-uint-conversion on i965.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ast_function.cpp

index 9e7c5995fc9fb574d90be059266dca53c411c240..ea3282c5f9428e84a7630cf2f2f5575d8b07705d 100644 (file)
@@ -452,8 +452,7 @@ convert_component(ir_rvalue *src, const glsl_type *desired_type)
         result = new(ctx) ir_expression(ir_unop_i2u, src);
         break;
       case GLSL_TYPE_FLOAT:
-        result = new(ctx) ir_expression(ir_unop_i2u,
-                 new(ctx) ir_expression(ir_unop_f2i, src));
+        result = new(ctx) ir_expression(ir_unop_f2u, src);
         break;
       case GLSL_TYPE_BOOL:
         result = new(ctx) ir_expression(ir_unop_i2u,