Zebediah Figura : vkd3d-shader/hlsl: Cast pow() input to float.
Alexandre Julliard
julliard at winehq.org
Fri Mar 18 16:38:45 CDT 2022
Module: vkd3d
Branch: master
Commit: 8fe4d7d37eb03bfd2c35245affa3b367f4f60856
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=8fe4d7d37eb03bfd2c35245affa3b367f4f60856
Author: Zebediah Figura <zfigura at 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 at codeweavers.com>
Signed-off-by: Francisco Casas <fcasas at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at 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);
More information about the wine-cvs
mailing list