mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
r600/sfn: remove duplicate barriers
Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9167>
This commit is contained in:
parent
fa588edf15
commit
a877ce1aba
1 changed files with 10 additions and 1 deletions
|
|
@ -94,6 +94,7 @@ public:
|
|||
int m_loop_nesting;
|
||||
int m_nliterals_in_group;
|
||||
std::set<int> vtx_fetch_results;
|
||||
bool m_last_op_was_barrier;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -159,6 +160,8 @@ bool AssemblyFromShaderLegacyImpl::emit(const Instruction::Pointer i)
|
|||
if (i->type() != Instruction::vtx)
|
||||
vtx_fetch_results.clear();
|
||||
|
||||
m_last_op_was_barrier &= i->type() == Instruction::alu;
|
||||
|
||||
sfn_log << SfnLog::assembly << "Emit from '" << *i << "\n";
|
||||
switch (i->type()) {
|
||||
case Instruction::alu:
|
||||
|
|
@ -219,7 +222,8 @@ AssemblyFromShaderLegacyImpl::AssemblyFromShaderLegacyImpl(r600_shader *sh,
|
|||
has_pos_output(false),
|
||||
has_param_output(false),
|
||||
m_loop_nesting(0),
|
||||
m_nliterals_in_group(0)
|
||||
m_nliterals_in_group(0),
|
||||
m_last_op_was_barrier(false)
|
||||
{
|
||||
m_max_color_exports = MAX2(m_key->ps.nr_cbufs, 1);
|
||||
}
|
||||
|
|
@ -250,6 +254,11 @@ bool AssemblyFromShaderLegacyImpl::emit_alu(const AluInstruction& ai, ECFAluOpCo
|
|||
return false;
|
||||
}
|
||||
|
||||
if (m_last_op_was_barrier && ai.opcode() == op0_group_barrier)
|
||||
return true;
|
||||
|
||||
m_last_op_was_barrier = ai.opcode() == op0_group_barrier;
|
||||
|
||||
unsigned old_nliterals_in_group = m_nliterals_in_group;
|
||||
for (unsigned i = 0; i < ai.n_sources(); ++i) {
|
||||
auto& s = ai.src(i);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue