mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader: Correctly dump array types.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
364621fa77
commit
60f7735b20
@@ -693,10 +693,27 @@ char *hlsl_type_to_string(const struct hlsl_type *type)
|
|||||||
return string;
|
return string;
|
||||||
|
|
||||||
case HLSL_CLASS_ARRAY:
|
case HLSL_CLASS_ARRAY:
|
||||||
name = hlsl_base_type_to_string(type->e.array.type);
|
{
|
||||||
if ((string = malloc(strlen(name) + 15)))
|
const struct hlsl_type *t;
|
||||||
sprintf(string, "%s[%u]", name, type->e.array.elements_count);
|
char *inner_string;
|
||||||
|
size_t len = 1;
|
||||||
|
|
||||||
|
for (t = type; t->type == HLSL_CLASS_ARRAY; t = t->e.array.type)
|
||||||
|
len += 14;
|
||||||
|
if (!(inner_string = hlsl_type_to_string(t)))
|
||||||
|
return NULL;
|
||||||
|
len += strlen(inner_string);
|
||||||
|
|
||||||
|
if ((string = malloc(len)))
|
||||||
|
{
|
||||||
|
strcpy(string, inner_string);
|
||||||
|
for (t = type; t->type == HLSL_CLASS_ARRAY; t = t->e.array.type)
|
||||||
|
sprintf(string + strlen(string), "[%u]", t->e.array.elements_count);
|
||||||
|
}
|
||||||
|
|
||||||
|
vkd3d_free(inner_string);
|
||||||
return string;
|
return string;
|
||||||
|
}
|
||||||
|
|
||||||
case HLSL_CLASS_STRUCT:
|
case HLSL_CLASS_STRUCT:
|
||||||
return vkd3d_strdup("<anonymous struct>");
|
return vkd3d_strdup("<anonymous struct>");
|
||||||
|
|||||||
Reference in New Issue
Block a user