From 45bd0be006b5ebafb7ab9a059de25be539381f11 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Mon, 24 Nov 2025 11:37:40 +0200 Subject: [PATCH] spirv: fix printf generation Not having the uses_printf will drop the printf info in serialization. Signed-off-by: Lionel Landwerlin Cc: mesa-stable Reviewed-by: Alyssa Rosenzweig (cherry picked from commit 67faf6dfbdadfc9d19859bcb9fe6dfc77d2edb78) Part-of: --- .pick_status.json | 2 +- src/compiler/spirv/spirv_to_nir.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 1b951efa169..b6fe0c75b26 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2404,7 +2404,7 @@ "description": "spirv: fix printf generation", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index d186da00f2a..7150419759a 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -827,6 +827,7 @@ vtn_handle_debug_printf(struct vtn_builder *b, SpvOp ext_opcode, struct vtn_value *format = vtn_value(b, w[5], vtn_value_type_string); + b->shader->info.uses_printf = true; b->shader->printf_info_count++; b->shader->printf_info = reralloc(b->shader, b->shader->printf_info, @@ -844,7 +845,7 @@ vtn_handle_debug_printf(struct vtn_builder *b, SpvOp ext_opcode, .string_size = strlen(format->str) + 1, }; - uint32_t info_index = b->shader->printf_info_count - 1; + uint32_t info_index = b->shader->printf_info_count; if (argc) { glsl_struct_field *fields = calloc(argc, sizeof(glsl_struct_field));