aco: Use program->num_waves as maximum in scheduler.

The scheduler doesn't take SGPR use into account, which can be
a limiting factor on older GPUs. This patch fixes a CTS test crash
on GFX6.

CC: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8040>
(cherry picked from commit 731f8fc9dd)
This commit is contained in:
Timur Kristóf 2020-12-10 18:54:43 +01:00 committed by Dylan Baker
parent a82561ec7f
commit 07562fcf66
2 changed files with 3 additions and 3 deletions

View file

@ -49,7 +49,7 @@
"description": "aco: Use program->num_waves as maximum in scheduler.",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": null
},

View file

@ -910,9 +910,9 @@ void schedule_program(Program *program, live& live_vars)
else
ctx.num_waves = 7;
ctx.num_waves = std::max<uint16_t>(ctx.num_waves, program->min_waves);
ctx.num_waves = std::min<uint16_t>(ctx.num_waves, program->max_waves);
ctx.num_waves = std::min<uint16_t>(ctx.num_waves, program->num_waves);
assert(ctx.num_waves > 0 && ctx.num_waves <= program->num_waves);
assert(ctx.num_waves > 0);
ctx.mv.max_registers = { int16_t(get_addr_vgpr_from_waves(program, ctx.num_waves) - 2),
int16_t(get_addr_sgpr_from_waves(program, ctx.num_waves))};