vkd3d-shader/hlsl: Invalidate components more precisely in copy propagation.

Signed-off-by: Francisco Casas <fcasas@codeweavers.com>
This commit is contained in:
Francisco Casas
2022-07-20 17:42:13 -04:00
committed by Alexandre Julliard
parent b5b08bd8a0
commit 1bba18aa75
Notes: Alexandre Julliard 2022-10-18 00:13:00 +02:00
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/7
3 changed files with 69 additions and 12 deletions

View File

@@ -140,6 +140,23 @@ unsigned int hlsl_type_major_size(const struct hlsl_type *type)
return type->dimx;
}
unsigned int hlsl_type_element_count(const struct hlsl_type *type)
{
switch (type->type)
{
case HLSL_CLASS_VECTOR:
return type->dimx;
case HLSL_CLASS_MATRIX:
return hlsl_type_major_size(type);
case HLSL_CLASS_ARRAY:
return type->e.array.elements_count;
case HLSL_CLASS_STRUCT:
return type->e.record.field_count;
default:
return 0;
}
}
static unsigned int get_array_size(const struct hlsl_type *type)
{
if (type->type == HLSL_CLASS_ARRAY)