From ed13c2261c46911136fdd1951f0017a7536a2871 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Mon, 30 Jan 2023 11:10:34 -0800 Subject: [PATCH] microsoft/compiler: Handle struct consts in DXIL module dumper Part-of: --- src/microsoft/compiler/dxil_dump.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/microsoft/compiler/dxil_dump.c b/src/microsoft/compiler/dxil_dump.c index a9ee119da8b..eeb76ce9080 100644 --- a/src/microsoft/compiler/dxil_dump.c +++ b/src/microsoft/compiler/dxil_dump.c @@ -385,6 +385,19 @@ dump_constants(struct dxil_dumper *d, struct list_head *list) } _mesa_string_buffer_append(d->buf, "}\n"); break; + case TYPE_STRUCT: + _mesa_string_buffer_append(d->buf, "{"); + for (unsigned i = 0; + i < cnst->value.type->struct_def.elem.num_types; i++) { + _mesa_string_buffer_printf(d->buf, " %%%d", + cnst->struct_values[i]->id); + dump_type_name(d, cnst->struct_values[i]->type); + if (i != cnst->value.type->struct_def.elem.num_types - 1) + _mesa_string_buffer_append(d->buf, ","); + _mesa_string_buffer_append(d->buf, " "); + } + _mesa_string_buffer_append(d->buf, "}\n"); + break; default: unreachable("Unsupported const type"); }