mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/fx: Use correct type name when reusing types.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
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
@ -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 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)
|
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;
|
struct type_entry *type_entry;
|
||||||
unsigned int elements_count;
|
unsigned int elements_count;
|
||||||
const char *name;
|
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)
|
if (type->class == HLSL_CLASS_ARRAY)
|
||||||
{
|
{
|
||||||
name = hlsl_get_multiarray_element_type(type)->name;
|
|
||||||
elements_count = hlsl_get_multiarray_size(type);
|
elements_count = hlsl_get_multiarray_size(type);
|
||||||
|
element_type = hlsl_get_multiarray_element_type(type);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
name = type->name;
|
|
||||||
elements_count = 0;
|
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)
|
LIST_FOR_EACH_ENTRY(type_entry, &fx->types, struct type_entry, entry)
|
||||||
{
|
{
|
||||||
if (strcmp(type_entry->name, name))
|
if (strcmp(type_entry->name, name))
|
||||||
|
Loading…
Reference in New Issue
Block a user