mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Move get_array_size() and get_array_type() to hlsl.c.
This commit is contained in:
committed by
Alexandre Julliard
parent
d5068fd3ff
commit
b589c2b32d
Notes:
Alexandre Julliard
2023-05-01 22:24:44 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Zebediah Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/148
@@ -157,10 +157,17 @@ unsigned int hlsl_type_element_count(const struct hlsl_type *type)
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned int get_array_size(const struct hlsl_type *type)
|
||||
const struct hlsl_type *hlsl_get_multiarray_element_type(const struct hlsl_type *type)
|
||||
{
|
||||
if (type->class == HLSL_CLASS_ARRAY)
|
||||
return get_array_size(type->e.array.type) * type->e.array.elements_count;
|
||||
return hlsl_get_multiarray_element_type(type->e.array.type);
|
||||
return type;
|
||||
}
|
||||
|
||||
unsigned int hlsl_get_multiarray_size(const struct hlsl_type *type)
|
||||
{
|
||||
if (type->class == HLSL_CLASS_ARRAY)
|
||||
return hlsl_get_multiarray_size(type->e.array.type) * type->e.array.elements_count;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -279,7 +286,7 @@ static void hlsl_type_calculate_reg_size(struct hlsl_ctx *ctx, struct hlsl_type
|
||||
type->reg_size[k] += field->type->reg_size[k];
|
||||
}
|
||||
|
||||
type->dimx += field->type->dimx * field->type->dimy * get_array_size(field->type);
|
||||
type->dimx += field->type->dimx * field->type->dimy * hlsl_get_multiarray_size(field->type);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user