Module: vkd3d Branch: master Commit: 106cbc02deff1eedaafa5326393f7dcedb2b043b URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/106cbc02deff1eedaafa5326393f7d...
Author: Zebediah Figura zfigura@codeweavers.com Date: Fri Jan 26 16:12:27 2024 -0600
vkd3d-shader/hlsl: Use hlsl_is_numeric_type() in type_has_object_components().
---
libs/vkd3d-shader/hlsl.y | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index f6da4755..e69359f9 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -2093,22 +2093,21 @@ static void initialize_var_components(struct hlsl_ctx *ctx, struct hlsl_block *i
static bool type_has_object_components(const struct hlsl_type *type) { - if (type->class == HLSL_CLASS_OBJECT) - return true; if (type->class == HLSL_CLASS_ARRAY) return type_has_object_components(type->e.array.type);
if (type->class == HLSL_CLASS_STRUCT) { - unsigned int i; - - for (i = 0; i < type->e.record.field_count; ++i) + for (unsigned int i = 0; i < type->e.record.field_count; ++i) { if (type_has_object_components(type->e.record.fields[i].type)) return true; } + + return false; } - return false; + + return !hlsl_is_numeric_type(type); }
static bool type_has_numeric_components(struct hlsl_type *type)