spirv: Fix debugPrintfEXT not working with multiple arguments

The struct field offsets weren't getting initialized.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41590>
This commit is contained in:
Calder Young 2026-05-14 15:53:46 -07:00 committed by Marge Bot
parent b333c9bd71
commit 768f4782e3

View file

@ -844,6 +844,7 @@ vtn_handle_debug_printf(struct vtn_builder *b, SpvOp ext_opcode,
if (argc) {
glsl_struct_field *fields = calloc(argc, sizeof(glsl_struct_field));
int next_offset = 0;
for (uint32_t i = 0; i < argc; i++) {
struct vtn_ssa_value *arg = vtn_ssa_value(b, w[6 + i]);
@ -852,8 +853,11 @@ vtn_handle_debug_printf(struct vtn_builder *b, SpvOp ext_opcode,
fields[i].type = glsl_vector_type(fields[i].type->base_type, arg->def->num_components);
fields[i].name = "";
fields[i].offset = next_offset;
info->arg_sizes[i] = arg->def->bit_size / 8;
int size = (int) arg->def->bit_size * arg->def->num_components / 8;
info->arg_sizes[i] = size;
next_offset += size;
}
nir_variable *packed_args = nir_local_variable_create(