mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Unify type minor/major size functions.
Signed-off-by: Francisco Casas <fcasas@codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
This commit is contained in:
committed by
Alexandre Julliard
parent
039b69ace9
commit
2dcfc888fb
Notes:
Alexandre Julliard
2022-10-18 00:13:00 +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/5
@@ -124,6 +124,22 @@ bool hlsl_type_is_row_major(const struct hlsl_type *type)
|
||||
return !!(type->modifiers & HLSL_MODIFIER_ROW_MAJOR);
|
||||
}
|
||||
|
||||
unsigned int hlsl_type_minor_size(const struct hlsl_type *type)
|
||||
{
|
||||
if (type->type != HLSL_CLASS_MATRIX || hlsl_type_is_row_major(type))
|
||||
return type->dimx;
|
||||
else
|
||||
return type->dimy;
|
||||
}
|
||||
|
||||
unsigned int hlsl_type_major_size(const struct hlsl_type *type)
|
||||
{
|
||||
if (type->type != HLSL_CLASS_MATRIX || hlsl_type_is_row_major(type))
|
||||
return type->dimy;
|
||||
else
|
||||
return type->dimx;
|
||||
}
|
||||
|
||||
static unsigned int get_array_size(const struct hlsl_type *type)
|
||||
{
|
||||
if (type->type == HLSL_CLASS_ARRAY)
|
||||
|
||||
Reference in New Issue
Block a user