r600/sfn: Override VPM if access in helpers is requested

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18343>
This commit is contained in:
Gert Wollny 2022-08-31 12:50:38 +02:00 committed by Marge Bot
parent 99ffb5203f
commit 5099bb5387
4 changed files with 16 additions and 4 deletions

View file

@ -887,9 +887,13 @@ void AssamblerVisitor::visit(const ControlFlowInstr& instr)
case ControlFlowInstr::cf_endif:
emit_endif();
break;
case ControlFlowInstr::cf_loop_begin:
emit_loop_begin(instr.has_instr_flag(Instr::vpm));
case ControlFlowInstr::cf_loop_begin: {
bool use_vpm = m_shader->processor_type == PIPE_SHADER_FRAGMENT &&
instr.has_instr_flag(Instr::vpm) &&
!instr.has_instr_flag(Instr::helper);
emit_loop_begin(use_vpm);
break;
}
case ControlFlowInstr::cf_loop_end:
emit_loop_end();
break;

View file

@ -69,6 +69,7 @@ public:
vpm,
force_cf,
ack_rat_return_write,
helper,
nflags
};

View file

@ -701,6 +701,9 @@ bool RatInstr::emit_image_store(nir_intrinsic_instr *intrin, Shader& shader)
image_offset, 1, 0xf, 0);
store->set_ack();
if (nir_intrinsic_access(intrin) & ACCESS_INCLUDE_HELPERS)
store->set_instr_flag(Instr::helper);
shader.emit_instruction(store);
return true;
}

View file

@ -1071,16 +1071,20 @@ void Shader::InstructionChain::visit(ScratchIOInstr *instr)
void Shader::InstructionChain::visit(GDSInstr *instr)
{
apply(instr, &last_gds_instr);
Instr::Flags flag = instr->has_instr_flag(Instr::helper) ?
Instr::helper: Instr::vpm;
for (auto& loop : this_shader->m_loops) {
loop->set_instr_flag(Instr::vpm);
loop->set_instr_flag(flag);
}
}
void Shader::InstructionChain::visit(RatInstr *instr)
{
apply(instr, &last_ssbo_instr);
Instr::Flags flag = instr->has_instr_flag(Instr::helper) ?
Instr::helper: Instr::vpm;
for (auto& loop : this_shader->m_loops) {
loop->set_instr_flag(Instr::vpm);
loop->set_instr_flag(flag);
}
if (prepare_mem_barrier)