diff options
author | Qiang Yu <yuq825@gmail.com> | 2023-04-26 14:58:58 +0800 |
---|---|---|
committer | Qiang Yu <yuq825@gmail.com> | 2023-04-28 11:33:28 +0800 |
commit | 3c59df73185852516c6ebcd9f62ee2cad07d0eb4 (patch) | |
tree | 4a572b9a3fd9cd861c6c405022cee50c470f4849 /src/amd/compiler/aco_spill.cpp | |
parent | 360176b671fc7ec30a75eb45557bd2c1fc019fec (diff) | |
download | mesa-3c59df73185852516c6ebcd9f62ee2cad07d0eb4.tar.gz |
aco: get scratch addr from symbol for radeonsi
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22727>
Diffstat (limited to 'src/amd/compiler/aco_spill.cpp')
-rw-r--r-- | src/amd/compiler/aco_spill.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/amd/compiler/aco_spill.cpp b/src/amd/compiler/aco_spill.cpp index d2cbca24405..3f8426921ae 100644 --- a/src/amd/compiler/aco_spill.cpp +++ b/src/amd/compiler/aco_spill.cpp @@ -1416,9 +1416,17 @@ load_scratch_resource(spill_ctx& ctx, Temp& scratch_offset, Block& block, return bld.copy(bld.def(s1), Operand::c32(offset)); Temp private_segment_buffer = ctx.program->private_segment_buffer; - if (ctx.program->stage.hw != HWStage::CS) + if (!private_segment_buffer.bytes()) { + Temp addr_lo = bld.sop1(aco_opcode::p_load_symbol, bld.def(s1), + Operand::c32(aco_symbol_scratch_addr_lo)); + Temp addr_hi = bld.sop1(aco_opcode::p_load_symbol, bld.def(s1), + Operand::c32(aco_symbol_scratch_addr_hi)); + private_segment_buffer = + bld.pseudo(aco_opcode::p_create_vector, bld.def(s2), addr_lo, addr_hi); + } else if (ctx.program->stage.hw != HWStage::CS) { private_segment_buffer = bld.smem(aco_opcode::s_load_dwordx2, bld.def(s2), private_segment_buffer, Operand::zero()); + } if (offset) scratch_offset = bld.sop2(aco_opcode::s_add_u32, bld.def(s1), bld.def(s1, scc), |