From: Dave Airlie <[email protected]> Some hardware has no conversion for these (cayman), so we want to lower them early using the common code. This adds a flag to allow the lowering pass to take these conversions into consideration.
Signed-off-by: Dave Airlie <[email protected]> --- src/compiler/glsl/ir_optimization.h | 2 ++ src/compiler/glsl/lower_64bit.cpp | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/compiler/glsl/ir_optimization.h b/src/compiler/glsl/ir_optimization.h index 5b21319261..0e76951bda 100644 --- a/src/compiler/glsl/ir_optimization.h +++ b/src/compiler/glsl/ir_optimization.h @@ -60,6 +60,8 @@ #define SIGN64 (1U << 1) #define DIV64 (1U << 2) #define MOD64 (1U << 3) +/* lower u->d and i->d */ +#define UI2D (1U << 4) /** * \see class lower_packing_builtins_visitor diff --git a/src/compiler/glsl/lower_64bit.cpp b/src/compiler/glsl/lower_64bit.cpp index b72b5cf799..a9b2b98f83 100644 --- a/src/compiler/glsl/lower_64bit.cpp +++ b/src/compiler/glsl/lower_64bit.cpp @@ -419,7 +419,17 @@ lower_64bit_visitor::handle_rvalue(ir_rvalue **rvalue) *rvalue = handle_op(ir, "__builtin_umul64", generate_ir::umul64); } break; - + case ir_unop_i2d: + if (lowering(UI2D)) { + assert(ir->type->base_type == GLSL_TYPE_DOUBLE); + *rvalue = handle_op(ir, "__builtin_int_to_fp64", generate_ir::int_to_fp64, true); + } + break; + case ir_unop_u2d: + if (lowering(UI2D)) { + assert(ir->type->base_type == GLSL_TYPE_DOUBLE); + *rvalue = handle_op(ir, "__builtin_uint_to_fp64", generate_ir::uint_to_fp64, true); + } default: break; } -- 2.14.3 _______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
