aco: fix gfx6-8 store_scratch() with function calls

Might happen with radv_emulate_rt=true.

Fixes the_great_circle/a6079328b8df7712 with polaris10.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: e006f68b11 ("aco/isel: Don't add scratch offset as gfx8- soffset if no offsets exist")
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
(cherry picked from commit 75722da909)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40092>
This commit is contained in:
Rhys Perry 2026-02-19 11:47:47 +00:00 committed by Eric Engestrom
parent bfeb230f9b
commit 849cdbcf72
2 changed files with 5 additions and 2 deletions

View file

@ -2174,7 +2174,7 @@
"description": "aco: fix gfx6-8 store_scratch() with function calls",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "e006f68b11ad7af8c0c4d7267ee04d9dfa1889a1",
"notes": null

View file

@ -3392,7 +3392,10 @@ visit_store_scratch(isel_context* ctx, nir_intrinsic_instr* instr)
offset = as_vgpr(ctx, offset);
for (unsigned i = 0; i < write_count; i++) {
aco_opcode op = get_buffer_store_op(write_datas[i].bytes());
Instruction* mubuf = bld.mubuf(op, rsrc, offset, ctx->program->scratch_offsets.back(),
Operand soffset = Operand::c32(0);
if (!ctx->program->scratch_offsets.empty())
soffset = Operand(ctx->program->scratch_offsets.back());
Instruction* mubuf = bld.mubuf(op, rsrc, offset, soffset,
write_datas[i], offsets[i], true);
mubuf->mubuf().sync = memory_sync_info(storage_scratch, semantic_private);
enum ac_access_type type =