diff options
author | Dave Airlie <[email protected]> | 2015-02-05 12:10:26 +0200 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2015-02-19 00:28:34 -0500 |
commit | 7aa3ffe2c5411d3cb2eee9f03ad1a92cb3629527 (patch) | |
tree | 0a69373844e725105cc26bb9aecde818fc00a427 /src | |
parent | 53383476d1ba2d863ac58087fd320a45d5c7a9a5 (diff) |
glsl: Support double loop control
Signed-off-by: Dave Airlie <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/loop_controls.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/glsl/loop_controls.cpp b/src/glsl/loop_controls.cpp index 1c1d34fefe6..2459fc1c303 100644 --- a/src/glsl/loop_controls.cpp +++ b/src/glsl/loop_controls.cpp @@ -102,9 +102,10 @@ calculate_iterations(ir_rvalue *from, ir_rvalue *to, ir_rvalue *increment, return -1; if (!iter->type->is_integer()) { + const ir_expression_operation op = iter->type->is_double() + ? ir_unop_d2i : ir_unop_f2i; ir_rvalue *cast = - new(mem_ctx) ir_expression(ir_unop_f2i, glsl_type::int_type, iter, - NULL); + new(mem_ctx) ir_expression(op, glsl_type::int_type, iter, NULL); iter = cast->constant_expression_value(); } @@ -134,6 +135,9 @@ calculate_iterations(ir_rvalue *from, ir_rvalue *to, ir_rvalue *increment, case GLSL_TYPE_FLOAT: iter = new(mem_ctx) ir_constant(float(iter_value + bias[i])); break; + case GLSL_TYPE_DOUBLE: + iter = new(mem_ctx) ir_constant(double(iter_value + bias[i])); + break; default: unreachable(!"Unsupported type for loop iterator."); } |