vkd3d-shader/fx: Use correct type name when reusing types.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2024-04-21 20:11:05 +02:00 committed by Alexandre Julliard
parent a913ac7844
commit 9c83caeda6
Notes: Alexandre Julliard 2024-05-16 23:13:33 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/868

View File

@ -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))