mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 20:00:10 +01:00
r600/nir: Pin interpolation results to channel
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>
This commit is contained in:
parent
5e036fef1f
commit
5d10e3ec60
3 changed files with 11 additions and 0 deletions
|
|
@ -623,6 +623,8 @@ bool FragmentShaderFromNir::load_interpolated_one_comp(GPRVector &dest,
|
||||||
auto ir = new AluInstruction(op, dest[chan], i & 1 ? ip.j : ip.i,
|
auto ir = new AluInstruction(op, dest[chan], i & 1 ? ip.j : ip.i,
|
||||||
PValue(new InlineConstValue(ALU_SRC_PARAM_BASE + io.lds_pos(), 0)),
|
PValue(new InlineConstValue(ALU_SRC_PARAM_BASE + io.lds_pos(), 0)),
|
||||||
i == 0 ? EmitInstruction::write : EmitInstruction::last);
|
i == 0 ? EmitInstruction::write : EmitInstruction::last);
|
||||||
|
dest.pin_to_channel(chan);
|
||||||
|
|
||||||
ir->set_bank_swizzle(alu_vec_210);
|
ir->set_bank_swizzle(alu_vec_210);
|
||||||
emit_instruction(ir);
|
emit_instruction(ir);
|
||||||
}
|
}
|
||||||
|
|
@ -636,6 +638,7 @@ bool FragmentShaderFromNir::load_interpolated_two_comp(GPRVector &dest, ShaderIn
|
||||||
for (unsigned i = 0; i < 4 ; ++i) {
|
for (unsigned i = 0; i < 4 ; ++i) {
|
||||||
ir = new AluInstruction(op, dest[i], i & 1 ? ip.j : ip.i, PValue(new InlineConstValue(ALU_SRC_PARAM_BASE + io.lds_pos(), 0)),
|
ir = new AluInstruction(op, dest[i], i & 1 ? ip.j : ip.i, PValue(new InlineConstValue(ALU_SRC_PARAM_BASE + io.lds_pos(), 0)),
|
||||||
(writemask & (1 << i)) ? EmitInstruction::write : EmitInstruction::empty);
|
(writemask & (1 << i)) ? EmitInstruction::write : EmitInstruction::empty);
|
||||||
|
dest.pin_to_channel(i);
|
||||||
ir->set_bank_swizzle(alu_vec_210);
|
ir->set_bank_swizzle(alu_vec_210);
|
||||||
emit_instruction(ir);
|
emit_instruction(ir);
|
||||||
}
|
}
|
||||||
|
|
@ -653,6 +656,7 @@ bool FragmentShaderFromNir::load_interpolated_two_comp_for_one(GPRVector &dest,
|
||||||
PValue(new InlineConstValue(ALU_SRC_PARAM_BASE + io.lds_pos(), 0)),
|
PValue(new InlineConstValue(ALU_SRC_PARAM_BASE + io.lds_pos(), 0)),
|
||||||
i == comp ? EmitInstruction::write : EmitInstruction::empty);
|
i == comp ? EmitInstruction::write : EmitInstruction::empty);
|
||||||
ir->set_bank_swizzle(alu_vec_210);
|
ir->set_bank_swizzle(alu_vec_210);
|
||||||
|
dest.pin_to_channel(i);
|
||||||
emit_instruction(ir);
|
emit_instruction(ir);
|
||||||
}
|
}
|
||||||
ir->set_flag(alu_last_instr);
|
ir->set_flag(alu_last_instr);
|
||||||
|
|
|
||||||
|
|
@ -146,6 +146,12 @@ void GPRVector::set_reg_i(int i, PValue reg)
|
||||||
m_elms[i] = reg;
|
m_elms[i] = reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GPRVector::pin_to_channel(int i)
|
||||||
|
{
|
||||||
|
auto& v = static_cast<GPRValue&>(*m_elms[i]);
|
||||||
|
v.pin_to_channel();
|
||||||
|
}
|
||||||
|
|
||||||
void GPRVector::do_print(std::ostream& os) const
|
void GPRVector::do_print(std::ostream& os) const
|
||||||
{
|
{
|
||||||
os << "R" << sel() << ".";
|
os << "R" << sel() << ".";
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,7 @@ public:
|
||||||
PValue operator [] (int i) const {return m_elms[i];}
|
PValue operator [] (int i) const {return m_elms[i];}
|
||||||
PValue& operator [] (int i) {return m_elms[i];}
|
PValue& operator [] (int i) {return m_elms[i];}
|
||||||
|
|
||||||
|
void pin_to_channel(int i);
|
||||||
|
|
||||||
PValue x() const {return m_elms[0];}
|
PValue x() const {return m_elms[0];}
|
||||||
PValue y() const {return m_elms[1];}
|
PValue y() const {return m_elms[1];}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue