mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
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:
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
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user