[PATCH vkd3d 3/8] vkd3d-shader/hlsl: Don't assert that the array element type has a nonzero register size.

Francisco Casas fcasas at codeweavers.com
Tue May 3 09:44:30 CDT 2022


Signed-off-by: Francisco Casas <fcasas at codeweavers.com>

I agree, it is also legal to declare empty structs, and we also will need to
represent implicit size arrays as size 0 arrays if they are incorrectly initialized.
(Unless we want to immediately abort when we find them).


May 3, 2022 6:14 AM, "Giovanni Mascellani" <gmascellani at codeweavers.com> wrote:

> From: Zebediah Figura <zfigura at codeweavers.com>
> 
> It's legal to declare arrays of object types, which don't.
> ---
> libs/vkd3d-shader/hlsl.c | 1 -
> 1 file changed, 1 deletion(-)
> 
> diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c
> index 7239b183..95ce9445 100644
> --- a/libs/vkd3d-shader/hlsl.c
> +++ b/libs/vkd3d-shader/hlsl.c
> @@ -165,7 +165,6 @@ static void hlsl_type_calculate_reg_size(struct hlsl_ctx *ctx, struct hlsl_type
> {
> unsigned int element_size = type->e.array.type->reg_size;
> 
> - assert(element_size);
> if (is_sm4)
> type->reg_size = (type->e.array.elements_count - 1) * align(element_size, 4) + element_size;
> else
> -- 
> 2.36.0



More information about the wine-devel mailing list