mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
r600/sfn: Don't clear clear group flag on vec4 that comes from TEX or FETCH
If we consider clearing the group flag of a vec4 register that is used as
source for some instruction we have to take into account that the parent
of the register element may also be part of a group in the parent instruction.
In this case we must not clear the group flag.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9118
Fixes: f3415cb26a (r600/sfn: copy propagate register load chains)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23813>
This commit is contained in:
parent
23d4e21d83
commit
34163e19f7
1 changed files with 40 additions and 0 deletions
|
|
@ -740,6 +740,36 @@ public:
|
|||
bool progress;
|
||||
};
|
||||
|
||||
class HasVecDestVisitor : public ConstInstrVisitor {
|
||||
public:
|
||||
HasVecDestVisitor():
|
||||
has_group_dest(false)
|
||||
{
|
||||
}
|
||||
|
||||
void visit(const AluInstr& instr) override { (void)instr; }
|
||||
void visit(const AluGroup& instr) override { (void)instr; }
|
||||
void visit(const TexInstr& instr) override { (void)instr; has_group_dest = true; };
|
||||
void visit(const ExportInstr& instr) override { (void)instr; }
|
||||
void visit(const FetchInstr& instr) override { (void)instr; has_group_dest = true; };
|
||||
void visit(const Block& instr) override { (void)instr; };
|
||||
void visit(const ControlFlowInstr& instr) override{ (void)instr; }
|
||||
void visit(const IfInstr& instr) override{ (void)instr; }
|
||||
void visit(const ScratchIOInstr& instr) override { (void)instr; };
|
||||
void visit(const StreamOutInstr& instr) override { (void)instr; }
|
||||
void visit(const MemRingOutInstr& instr) override { (void)instr; }
|
||||
void visit(const EmitVertexInstr& instr) override { (void)instr; }
|
||||
void visit(const GDSInstr& instr) override { (void)instr; }
|
||||
void visit(const WriteTFInstr& instr) override { (void)instr; };
|
||||
void visit(const LDSAtomicInstr& instr) override { (void)instr; };
|
||||
void visit(const LDSReadInstr& instr) override { (void)instr; };
|
||||
void visit(const RatInstr& instr) override { (void)instr; };
|
||||
|
||||
bool has_group_dest;
|
||||
};
|
||||
|
||||
|
||||
|
||||
bool
|
||||
simplify_source_vectors(Shader& sh)
|
||||
{
|
||||
|
|
@ -765,6 +795,16 @@ SimplifySourceVecVisitor::visit(TexInstr *instr)
|
|||
if (nvals == 1) {
|
||||
for (int i = 0; i < 4; ++i)
|
||||
if (src[i]->chan() < 4) {
|
||||
HasVecDestVisitor check_dests;
|
||||
for (auto p : src[i]->parents()) {
|
||||
p->accept(check_dests);
|
||||
if (check_dests.has_group_dest)
|
||||
break;
|
||||
}
|
||||
|
||||
if (check_dests.has_group_dest)
|
||||
break;
|
||||
|
||||
if (src[i]->pin() == pin_group)
|
||||
src[i]->set_pin(pin_free);
|
||||
else if (src[i]->pin() == pin_chgr)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue