mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 02:38:04 +02:00
r600/sfn: use only one undef in tex lowering
Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19729>
This commit is contained in:
parent
df54aa7e33
commit
e5646382ba
1 changed files with 11 additions and 1 deletions
|
|
@ -960,7 +960,10 @@ private:
|
|||
nir_ssa_def *
|
||||
finalize(nir_tex_instr *tex, nir_ssa_def *backend1, nir_ssa_def *backend2);
|
||||
|
||||
nir_ssa_def *get_undef();
|
||||
|
||||
amd_gfx_level m_chip_class;
|
||||
nir_ssa_def *m_undef {nullptr};
|
||||
};
|
||||
|
||||
bool
|
||||
|
|
@ -999,6 +1002,13 @@ LowerTexToBackend::filter(const nir_instr *instr) const
|
|||
return nir_tex_instr_src_index(tex, nir_tex_src_backend1) == -1;
|
||||
}
|
||||
|
||||
nir_ssa_def *LowerTexToBackend::get_undef()
|
||||
{
|
||||
if (!m_undef)
|
||||
m_undef = nir_ssa_undef(b, 1, 32);
|
||||
return m_undef;
|
||||
}
|
||||
|
||||
nir_ssa_def *
|
||||
LowerTexToBackend::lower(nir_instr *instr)
|
||||
{
|
||||
|
|
@ -1160,7 +1170,7 @@ LowerTexToBackend::prep_src(std::array<nir_ssa_def *, 4>& coord, int& used_coord
|
|||
if (coord[i])
|
||||
used_coord_mask |= 1 << i;
|
||||
else
|
||||
coord[i] = nir_ssa_undef(b, 1, 32);
|
||||
coord[i] = get_undef();
|
||||
}
|
||||
|
||||
return nir_vec(b, coord.data(), 4);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue