vkd3d-shader/hlsl: Support multiple-register variables in object regsets.

Variables that contain more than one object (arrays or structs) require
the allocation of contiguous registers in the respective object
register spaces.
This commit is contained in:
Francisco Casas
2023-04-25 12:41:38 -04:00
committed by Alexandre Julliard
parent 9a8a440b9b
commit 69ff249ef4
Notes: Alexandre Julliard 2023-05-08 22:34:16 +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/159
6 changed files with 95 additions and 42 deletions

View File

@@ -173,6 +173,9 @@ unsigned int hlsl_get_multiarray_size(const struct hlsl_type *type)
bool hlsl_type_is_resource(const struct hlsl_type *type)
{
if (type->class == HLSL_CLASS_ARRAY)
return hlsl_type_is_resource(type->e.array.type);
if (type->class == HLSL_CLASS_OBJECT)
{
switch (type->base_type)
@@ -193,6 +196,9 @@ enum hlsl_regset hlsl_type_get_regset(const struct hlsl_type *type)
if (type->class <= HLSL_CLASS_LAST_NUMERIC)
return HLSL_REGSET_NUMERIC;
if (type->class == HLSL_CLASS_ARRAY)
return hlsl_type_get_regset(type->e.array.type);
if (type->class == HLSL_CLASS_OBJECT)
{
switch (type->base_type)
@@ -210,8 +216,6 @@ enum hlsl_regset hlsl_type_get_regset(const struct hlsl_type *type)
vkd3d_unreachable();
}
}
else if (type->class == HLSL_CLASS_ARRAY)
return hlsl_type_get_regset(type->e.array.type);
vkd3d_unreachable();
}