[PATCH vkd3d v3 13/17] vkd3d-shader/hlsl: Replace register offsets with index paths in resource loads initialization.

Giovanni Mascellani wine at mascellani.eu
Fri Jul 22 07:36:06 CDT 2022


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

but with a small notice:

Il 20/07/22 15:23, Francisco Casas ha scritto:
> diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c
> index 2d5fe40a..a4d594b7 100644
> --- a/libs/vkd3d-shader/hlsl.c
> +++ b/libs/vkd3d-shader/hlsl.c
> @@ -862,6 +862,28 @@ static bool type_is_single_reg(const struct hlsl_type *type)
>       return type->type == HLSL_CLASS_SCALAR || type->type == HLSL_CLASS_VECTOR;
>   }
>   
> +static bool deref_copy(struct hlsl_ctx *ctx, struct hlsl_deref *deref, struct hlsl_deref *other)
> +{
> +    unsigned int i;
> +
> +    memset(deref, 0, sizeof(*deref));
> +
> +    if (!other)
> +        return true;
> +
> +    assert(!other->offset.node);
> +
> +    if (!init_deref(ctx, deref, other->var, other->path_len))
> +        return false;
> +
> +    for (i = 0; i < deref->path_len; ++i)
> +        hlsl_src_from_node(&deref->path[i], other->path[i].node);
> +
> +    hlsl_src_from_node(&deref->offset, other->offset.node);

You just asserted that other->offset.node is NULL and *deref was 
initialized to zero, so that seems to be a noop, doesn't it?

Thanks, Giovanni.



More information about the wine-devel mailing list