Zebediah Figura : vkd3d-shader/hlsl: Cast pow() input to float.
Module: vkd3d Branch: master Commit: 8fe4d7d37eb03bfd2c35245affa3b367f4f60856 URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=8fe4d7d37eb03bfd2c35245a... Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue Mar 8 17:58:13 2022 -0600 vkd3d-shader/hlsl: Cast pow() input to float. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Francisco Casas <fcasas(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/hlsl.y | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index dc9b1439..1ab56fba 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -1800,10 +1800,13 @@ static bool intrinsic_min(struct hlsl_ctx *ctx, static bool intrinsic_pow(struct hlsl_ctx *ctx, const struct parse_initializer *params, const struct vkd3d_shader_location *loc) { - struct hlsl_ir_node *log, *exp; + struct hlsl_ir_node *log, *exp, *arg; struct hlsl_ir_expr *mul; - if (!(log = hlsl_new_unary_expr(ctx, HLSL_OP1_LOG2, params->args[0], *loc))) + if (!(arg = intrinsic_float_convert_arg(ctx, params, params->args[0], loc))) + return false; + + if (!(log = hlsl_new_unary_expr(ctx, HLSL_OP1_LOG2, arg, *loc))) return false; list_add_tail(params->instrs, &log->entry);
participants (1)
-
Alexandre Julliard