From 54e1e8897050c453f8e528a8c69f747692db3593 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Thu, 23 Apr 2026 00:03:20 -0700 Subject: [PATCH] brw: Fix max_dispatch_width collection for CS with variable size The intention of the original commit was to make all the shaders report the same max_dispatch_width. When CS has multiple variants, this was not happening as expected. Fixes: 2acc2f18ea7 ("intel/compiler: report max dispatch width statistic") Reviewed-by: Lionel Landwerlin (cherry picked from commit e1745e0bd93d25c5d70bd1de884a86a0ade0adf9) Part-of: --- .pick_status.json | 2 +- src/intel/compiler/brw/brw_compile_cs.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 7a95d7bec2b..f8572cb131d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3244,7 +3244,7 @@ "description": "brw: Fix max_dispatch_width collection for CS with variable size", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "2acc2f18ea74e5f59b1e6f67fec49fd0c6b1e466", "notes": null diff --git a/src/intel/compiler/brw/brw_compile_cs.cpp b/src/intel/compiler/brw/brw_compile_cs.cpp index 612262bda97..1e48151807d 100644 --- a/src/intel/compiler/brw/brw_compile_cs.cpp +++ b/src/intel/compiler/brw/brw_compile_cs.cpp @@ -261,7 +261,8 @@ brw_compile_cs(const struct brw_compiler *compiler, g.enable_debug(name); } - uint32_t max_dispatch_width = 8u << (util_last_bit(prog_data->prog_mask) - 1); + const uint32_t max_dispatch_width = + 8u << (util_last_bit(prog_data->prog_mask) - 1); struct genisa_stats *stats = params->base.stats; for (unsigned simd = 0; simd < 3; simd++) { @@ -274,8 +275,6 @@ brw_compile_cs(const struct brw_compiler *compiler, prog_data->base.grf_used = MAX2(prog_data->base.grf_used, v[simd]->grf_used); - - max_dispatch_width = 8u << simd; } }