[PATCH vkd3d 1/6] vkd3d-shader/hlsl: Cast pow() input to float.

Francisco Casas fcasas at codeweavers.com
Wed Mar 9 08:56:02 CST 2022


Signed-off-by: Francisco Casas <fcasas at codeweavers.com>

March 8, 2022 8:58 PM, "Zebediah Figura" <zfigura at codeweavers.com> wrote:

> Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
> ---
> 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 92dcb3f2a..1e85e390c 100644
> --- a/libs/vkd3d-shader/hlsl.y
> +++ b/libs/vkd3d-shader/hlsl.y
> @@ -1806,10 +1806,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);
> 
> -- 
> 2.35.1



More information about the wine-devel mailing list