[PATCH vkd3d 5/5] vkd3d-shader: Use struct vkd3d_shader_location in struct hlsl_ctx.

Matteo Bruni matteo.mystral at gmail.com
Fri Feb 12 10:40:36 CST 2021


On Wed, Feb 10, 2021 at 10:43 PM Zebediah Figura
<zfigura at codeweavers.com> wrote:
>
> Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
> ---
>  libs/vkd3d-shader/hlsl.c | 11 +++++------
>  libs/vkd3d-shader/hlsl.h |  4 +---
>  libs/vkd3d-shader/hlsl.l | 12 +++++-------
>  libs/vkd3d-shader/hlsl.y |  6 +++---
>  4 files changed, 14 insertions(+), 19 deletions(-)
>
> diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c
> index 6f19cbb3..2db9e85e 100644
> --- a/libs/vkd3d-shader/hlsl.c
> +++ b/libs/vkd3d-shader/hlsl.c
> @@ -1484,16 +1484,15 @@ static bool hlsl_ctx_init(struct hlsl_ctx *ctx, struct vkd3d_shader_message_cont
>
>      ctx->message_context = message_context;
>
> -    ctx->line_no = ctx->column = 1;
> -    if (!(ctx->source_file = vkd3d_strdup("")))
> -        return false;
>      if (!(ctx->source_files = vkd3d_malloc(sizeof(*ctx->source_files))))
> +        return false;
> +    if (!(ctx->source_files[0] = vkd3d_strdup("")))
>      {
> -        vkd3d_free((void *)ctx->source_file);
> +        vkd3d_free(ctx->source_files);
>          return false;
>      }
> -    ctx->source_files[0] = ctx->source_file;
> -    ctx->source_files_count = 1;
> +    ctx->location.source_name = ctx->source_files[0];
> +    ctx->location.line = ctx->location.column = 1;
>
>      ctx->matrix_majority = HLSL_COLUMN_MAJOR;

This doesn't initialize source_files_count to 1 anymore, isn't that
still necessary?



More information about the wine-devel mailing list