From b055af7cebcf2dee3a41662ca934f7a476cf0394 Mon Sep 17 00:00:00 2001 From: Natalie Vock Date: Thu, 22 Jan 2026 13:25:32 +0100 Subject: [PATCH] aco: Fix parameter stack size calculation This only accounted for 1/32 (or 1/64) of the actual parameter size. In some cases this meant that some threads were smashing other threads' stacks. Cc: mesa-stable Part-of: (cherry picked from commit 15328a5ef35593795f2b9939ed279a39272b8704) --- .pick_status.json | 2 +- src/amd/compiler/instruction_selection/aco_isel_helpers.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 19b371e6767..856b48b07fe 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3454,7 +3454,7 @@ "description": "aco: Fix parameter stack size calculation", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/amd/compiler/instruction_selection/aco_isel_helpers.cpp b/src/amd/compiler/instruction_selection/aco_isel_helpers.cpp index c0393e2db0a..f9bff68dce2 100644 --- a/src/amd/compiler/instruction_selection/aco_isel_helpers.cpp +++ b/src/amd/compiler/instruction_selection/aco_isel_helpers.cpp @@ -672,7 +672,7 @@ build_end_with_regs(isel_context* ctx, std::vector& regs) Instruction* add_startpgm(struct isel_context* ctx, bool is_callee) { - ctx->program->scratch_arg_size += ctx->callee_info.scratch_param_size; + ctx->program->scratch_arg_size += ctx->callee_info.scratch_param_size * ctx->program->wave_size; unsigned def_count = 0; for (unsigned i = 0; i < ctx->args->arg_count; i++) {