[PATCH vkd3d v5 7/8] vkd3d-shader/hlsl: Remove redundant type check in declare_vars().

Giovanni Mascellani gmascellani at codeweavers.com
Mon Mar 14 08:13:32 CDT 2022


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

Il 10/03/22 16:14, Francisco Casas ha scritto:
> Signed-off-by: Francisco Casas <fcasas at codeweavers.com>
> Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
> 
> ---
> v5:
>   - No changes from v4.
> 
> Signed-off-by: Francisco Casas <fcasas at codeweavers.com>
> ---
>   libs/vkd3d-shader/hlsl.y | 14 ++++----------
>   1 file changed, 4 insertions(+), 10 deletions(-)
> 
> diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y
> index 0b6093ba..d6ba2c12 100644
> --- a/libs/vkd3d-shader/hlsl.y
> +++ b/libs/vkd3d-shader/hlsl.y
> @@ -1623,23 +1623,17 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t
>                   continue;
>               }
>   
> -            if (type->type == HLSL_CLASS_STRUCT)
> -            {
> -                struct_var_initializer(ctx, statements_list, var, &v->initializer);
> -                vkd3d_free(v);
> -                continue;
> -            }
> -            if (type->type > HLSL_CLASS_LAST_NUMERIC)
> +            if (type->type > HLSL_CLASS_LAST_NUMERIC && type->type != HLSL_CLASS_STRUCT)
>               {
>                   FIXME("Initializers for non scalar/struct variables not supported yet.\n");
>                   free_parse_initializer(&v->initializer);
>                   vkd3d_free(v);
>                   continue;
>               }
> -            if (v->arrays.count)
> +
> +            if (type->type == HLSL_CLASS_STRUCT)
>               {
> -                hlsl_fixme(ctx, &v->loc, "Array initializer.");
> -                free_parse_initializer(&v->initializer);
> +                struct_var_initializer(ctx, statements_list, var, &v->initializer);
>                   vkd3d_free(v);
>                   continue;
>               }



More information about the wine-devel mailing list