diff --git a/.pick_status.json b/.pick_status.json index 4f8cb28503b..5b71379c644 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -5254,7 +5254,7 @@ "description": "ir3: Fix constlen trimming when more than one stage is trimmed", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/freedreno/ir3/ir3_shader.c b/src/freedreno/ir3/ir3_shader.c index d94cc2e73f3..bad580c23fe 100644 --- a/src/freedreno/ir3/ir3_shader.c +++ b/src/freedreno/ir3/ir3_shader.c @@ -830,11 +830,12 @@ trim_constlens(unsigned *constlens, unsigned first_stage, unsigned last_stage, cur_total += constlens[i]; } - unsigned max_stage = 0; - unsigned max_const = 0; uint32_t trimmed = 0; while (cur_total > combined_limit) { + unsigned max_stage = 0; + unsigned max_const = 0; + for (unsigned i = first_stage; i <= last_stage; i++) { if (constlens[i] >= max_const) { max_stage = i;