From 9c83caeda652d7968c10e54cca2ae3b7fc18f384 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Sun, 21 Apr 2024 20:11:05 +0200 Subject: [PATCH] vkd3d-shader/fx: Use correct type name when reusing types. Signed-off-by: Nikolay Sivov --- libs/vkd3d-shader/fx.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/vkd3d-shader/fx.c b/libs/vkd3d-shader/fx.c index 9ad33f25..57b4ac24 100644 --- a/libs/vkd3d-shader/fx.c +++ b/libs/vkd3d-shader/fx.c @@ -129,9 +129,11 @@ static void write_pass(struct hlsl_ir_var *var, struct fx_write_context *fx) } static uint32_t write_fx_4_type(const struct hlsl_type *type, struct fx_write_context *fx); +static const char * get_fx_4_type_name(const struct hlsl_type *type); static uint32_t write_type(const struct hlsl_type *type, struct fx_write_context *fx) { + const struct hlsl_type *element_type; struct type_entry *type_entry; unsigned int elements_count; const char *name; @@ -140,15 +142,17 @@ static uint32_t write_type(const struct hlsl_type *type, struct fx_write_context if (type->class == HLSL_CLASS_ARRAY) { - name = hlsl_get_multiarray_element_type(type)->name; elements_count = hlsl_get_multiarray_size(type); + element_type = hlsl_get_multiarray_element_type(type); } else { - name = type->name; elements_count = 0; + element_type = type; } + name = get_fx_4_type_name(element_type); + LIST_FOR_EACH_ENTRY(type_entry, &fx->types, struct type_entry, entry) { if (strcmp(type_entry->name, name))