return true;
}
+void Shader::InstructionChain::visit(AluInstr *instr)
+{
+ if (instr->is_kill()) {
+ last_kill_instr = instr;
+
+ // these instructions have side effects, they should
+ // not be re-order with kill
+ if (last_gds_instr)
+ instr->add_required_instr(last_gds_instr);
+
+ if (last_ssbo_instr)
+ instr->add_required_instr(last_ssbo_instr);
+ }
+}
+
void
Shader::InstructionChain::visit(ScratchIOInstr *instr)
{
for (auto& loop : this_shader->m_loops) {
loop->set_instr_flag(flag);
}
+ if (last_kill_instr)
+ instr->add_required_instr(last_kill_instr);
+
}
void
if (this_shader->m_current_block->inc_rat_emitted() > 15)
this_shader->start_new_block(0);
+
+ if (last_kill_instr)
+ instr->add_required_instr(last_kill_instr);
}
void
class InstructionChain : public InstrVisitor {
public:
- void visit(AluInstr *instr) override { (void)instr; }
void visit(AluGroup *instr) override { (void)instr; }
void visit(TexInstr *instr) override { (void)instr; }
void visit(ExportInstr *instr) override { (void)instr; }
void visit(LDSAtomicInstr *instr) override { (void)instr; }
void visit(LDSReadInstr *instr) override { (void)instr; }
+ void visit(AluInstr *instr) override;
void visit(ScratchIOInstr *instr) override;
void visit(GDSInstr *instr) override;
void visit(RatInstr *instr) override;
Instr *last_scratch_instr{nullptr};
Instr *last_gds_instr{nullptr};
Instr *last_ssbo_instr{nullptr};
+ Instr *last_kill_instr{nullptr};
bool prepare_mem_barrier{false};
};