vkd3d-shader/hlsl: Allow uint1-typed deref path nodes.

When derefs with non-constant indices are copy-propagated, it is
possible to end up with uint1-typed path nodes.

Also, introduce hlsl_is_vec1().
This commit is contained in:
Shaun Ren
2025-02-20 22:13:57 -05:00
committed by Henri Verbeet
parent 766492d1cc
commit 1c2434f4d3
Notes: Henri Verbeet 2025-03-12 22:20:19 +01:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1388
2 changed files with 11 additions and 14 deletions

View File

@@ -1458,6 +1458,11 @@ static inline bool hlsl_is_numeric_type(const struct hlsl_type *type)
return type->class <= HLSL_CLASS_LAST_NUMERIC;
}
static inline bool hlsl_is_vec1(const struct hlsl_type *type)
{
return type->class == HLSL_CLASS_SCALAR || (type->class == HLSL_CLASS_VECTOR && type->e.numeric.dimx == 1);
}
static inline unsigned int hlsl_sampler_dim_count(enum hlsl_sampler_dim dim)
{
switch (dim)