[v2 PATCH vkd3d 2/4] vkd3d-shader/hlsl: Cast round() input to float.

Giovanni Mascellani gmascellani at codeweavers.com
Tue Dec 21 06:41:41 CST 2021


Hi,

On 19/12/21 13:41, Nikolay Sivov wrote:
> @@ -1675,7 +1687,8 @@ static bool intrinsic_pow(struct hlsl_ctx *ctx,
>   static bool intrinsic_round(struct hlsl_ctx *ctx,
>           const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
>   {
> -    return !!add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_ROUND, params->args[0], loc);
> +    struct hlsl_ir_node *arg = intrinsic_float_convert_arg(ctx, params, params->args[0], loc);
> +    return !!add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_ROUND, arg, loc);
>   }

add_unary_arithmetic_expr() assume that the nodes it receives are not 
NULL, therefore you should check before passing.

Same thing for the following patches.

Giovanni.



More information about the wine-devel mailing list