From 52cc6c101ff78eee60f810aa58e44dd0d5cb8608 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 7 May 2025 12:22:09 -0400 Subject: [PATCH] nir/lower_printf: fix vectors with nir_printf_fmt for specifiers like %v4f, we need to store the whole vector. u_printf can already handle this from OpenCL, we just need to match that here. Signed-off-by: Alyssa Rosenzweig Acked-by: Lionel Landwerlin Part-of: --- src/compiler/nir/nir_lower_printf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_lower_printf.c b/src/compiler/nir/nir_lower_printf.c index 6030a12dbed..d83c56a921c 100644 --- a/src/compiler/nir/nir_lower_printf.c +++ b/src/compiler/nir/nir_lower_printf.c @@ -263,6 +263,7 @@ nir_vprintf_fmt(nir_builder *b, unsigned ptr_bit_size, const char *fmt, va_list ASSERTED nir_def *def = va_arg(ap, nir_def *); assert(def->bit_size / 8 == arg_size); + arg_size *= def->num_components; info.num_args++; info.arg_sizes = reralloc(b->shader, info.arg_sizes, unsigned, @@ -300,7 +301,7 @@ nir_vprintf_fmt(nir_builder *b, unsigned ptr_bit_size, const char *fmt, va_list nir_def *def = va_arg(ap, nir_def *); nir_store_global(b, nir_iadd_imm(b, store_addr, store_offset), - 4, def, 0x1); + 4, def, nir_component_mask(def->num_components)); store_offset += info.arg_sizes[a]; }