From 8fe4d7d37eb03bfd2c35245affa3b367f4f60856 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Tue, 8 Mar 2022 17:58:13 -0600 Subject: [PATCH] vkd3d-shader/hlsl: Cast pow() input to float. Signed-off-by: Zebediah Figura Signed-off-by: Francisco Casas Signed-off-by: Henri Verbeet Signed-off-by: Giovanni Mascellani Signed-off-by: Matteo Bruni Signed-off-by: Alexandre Julliard --- 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);