From 0d19fc8256a9f2ae807d3f5c80d2099edae64ffa Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Wed, 28 Jan 2026 14:42:37 -0800 Subject: [PATCH] brw: Fix "GRF registers" stats output Pick the value from the brw_shader instead of from the prog_data, since when there are multiple variants, the prog_data one will have the maximum value. Picking the wrong value also caused compute shaders that had a single variant to report 0 GRFs since the prog_data was being filled after the generate_code() call. Issue spotted by Felix DeGrood. Reviewed-by: Alyssa Rosenzweig Part-of: --- src/intel/compiler/brw/brw_generator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/compiler/brw/brw_generator.cpp b/src/intel/compiler/brw/brw_generator.cpp index eda3bef3486..c2fef8a9d3c 100644 --- a/src/intel/compiler/brw/brw_generator.cpp +++ b/src/intel/compiler/brw/brw_generator.cpp @@ -1454,7 +1454,7 @@ brw_generator::generate_code(const brw_shader &s, stats->max_live_registers = shader_stats.max_register_pressure; stats->non_ssa_regs_after_nir = shader_stats.non_ssa_registers_after_nir; stats->source_hash = prog_data->source_hash; - stats->grf_registers = devinfo->ver >= 30 ? prog_data->grf_used : 0; + stats->grf_registers = devinfo->ver >= 30 ? s.grf_used : 0; /* Report the max dispatch width only on the smallest SIMD variant. *