diff options
author | Zebediah Figura <zfigura@codeweavers.com> | 2022-05-17 08:59:14 +0300 |
---|---|---|
committer | Giovanni Mascellani <gmascellani@codeweavers.com> | 2022-07-26 15:48:53 +0300 |
commit | dad159a2c5ee94cd2395cf0a2a108cbfe0a6df74 (patch) | |
tree | 4e12423b46d5f3e4809e2f6c42d590e4f0fcda62 | |
parent | 3334a4e9d56ca5ddafee34ae767ac89207cac3c2 (diff) |
vkd3d-shader/hlsl: Apply latent type modifiers to matrix array typedefs.
-rw-r--r-- | libs/vkd3d-shader/hlsl.y | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index f0f9e792..348c4003 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -991,7 +991,8 @@ static bool gen_struct_fields(struct hlsl_ctx *ctx, struct parse_fields *fields, return true; } -static bool add_typedef(struct hlsl_ctx *ctx, DWORD modifiers, struct hlsl_type *orig_type, struct list *list) +static bool add_typedef(struct hlsl_ctx *ctx, const unsigned int modifiers, + struct hlsl_type *orig_type, struct list *list) { struct parse_variable_def *v, *v_next; struct hlsl_type *type; @@ -1000,6 +1001,8 @@ static bool add_typedef(struct hlsl_ctx *ctx, DWORD modifiers, struct hlsl_type LIST_FOR_EACH_ENTRY_SAFE(v, v_next, list, struct parse_variable_def, entry) { + unsigned int var_modifiers = modifiers; + if (!v->arrays.count) { if (!(type = hlsl_type_clone(ctx, orig_type, 0, modifiers))) @@ -1010,7 +1013,11 @@ static bool add_typedef(struct hlsl_ctx *ctx, DWORD modifiers, struct hlsl_type } else { - type = orig_type; + if (!(type = apply_type_modifiers(ctx, orig_type, &var_modifiers, v->loc))) + { + free_parse_variable_def(v); + continue; + } } ret = true; |