[PATCH vkd3d 02/12] vkd3d-shader/hlsl: Pass field to add_record_load() via index.

Giovanni Mascellani gmascellani at codeweavers.com
Tue Jul 5 04:25:34 CDT 2022


Hi,

Il 01/07/22 23:24, Francisco Casas ha scritto:
>   static const struct hlsl_struct_field *get_struct_field(const struct hlsl_struct_field *fields,
> -        size_t count, const char *name)
> +        size_t count, const char *name, unsigned int *field_indx)
>   {
>       size_t i;
>   
>       for (i = 0; i < count; ++i)
>       {
>           if (!strcmp(fields[i].name, name))
> +        {
> +            if (field_indx)
> +                *field_indx = i;
>               return &fields[i];
> +        }
>       }
>       return NULL;
>   }

It's not a big deal, but this interface looks more complicated than it 
should for such a simple thing. Maybe we could just return the field 
index and the caller can dereference the array if needed?

Giovanni.



More information about the wine-devel mailing list