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

Giovanni Mascellani gmascellani at codeweavers.com
Mon Mar 14 09:19:16 CDT 2022


Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>

Il 09/03/22 00:58, Zebediah Figura ha scritto:
> 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);
>   



More information about the wine-devel mailing list