aco/lower_to_hw_instr: Run p_init_scratch if the program has a call

Callees may use scratch even if the caller doesn't.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40008>
This commit is contained in:
Natalie Vock 2026-04-07 12:17:13 +02:00 committed by Marge Bot
parent 378c9536de
commit b53dc3f052

View file

@ -2746,7 +2746,7 @@ lower_to_hw_instr(Program* program)
}
case aco_opcode::p_init_scratch: {
assert(program->gfx_level >= GFX8 && program->gfx_level <= GFX10_3);
if (!program->config->scratch_bytes_per_wave)
if (!program->config->scratch_bytes_per_wave && !program->has_call)
break;
Operand scratch_addr = instr->operands[0];