nak: Add MemEvictionPriorities to tex ops

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33427>
This commit is contained in:
Faith Ekstrand 2025-02-06 07:43:34 -06:00 committed by Marge Bot
parent ac50208783
commit bc67f95ae2
3 changed files with 16 additions and 4 deletions

View file

@ -1832,6 +1832,7 @@ impl<'a> ShaderFromNir<'a> {
srcs: srcs,
dim: dim,
offset: offset_mode == Tld4OffsetMode::AddOffI,
mem_eviction_priority: MemEvictionPriority::Normal,
mask: mask,
});
} else if tex.op == nir_texop_lod {
@ -1854,6 +1855,7 @@ impl<'a> ShaderFromNir<'a> {
lod_mode: lod_mode,
is_ms: tex.op == nir_texop_txf_ms,
offset: offset_mode == Tld4OffsetMode::AddOffI,
mem_eviction_priority: MemEvictionPriority::Normal,
mask: mask,
});
} else if tex.op == nir_texop_tg4 {
@ -1866,6 +1868,7 @@ impl<'a> ShaderFromNir<'a> {
comp: tex.component().try_into().unwrap(),
offset_mode: offset_mode,
z_cmpr: flags.has_z_cmpr(),
mem_eviction_priority: MemEvictionPriority::Normal,
mask: mask,
});
} else {
@ -1879,6 +1882,7 @@ impl<'a> ShaderFromNir<'a> {
lod_mode: lod_mode,
z_cmpr: flags.has_z_cmpr(),
offset: offset_mode == Tld4OffsetMode::AddOffI,
mem_eviction_priority: MemEvictionPriority::Normal,
mask: mask,
});
}

View file

@ -4675,6 +4675,7 @@ pub struct OpTex {
pub lod_mode: TexLodMode,
pub z_cmpr: bool,
pub offset: bool,
pub mem_eviction_priority: MemEvictionPriority,
pub mask: u8,
}
@ -4690,6 +4691,7 @@ impl DisplayOp for OpTex {
if self.z_cmpr {
write!(f, ".dc")?;
}
write!(f, "{}", self.mem_eviction_priority)?;
write!(f, " {} {} {}", self.tex, self.srcs[0], self.srcs[1])
}
}
@ -4710,6 +4712,7 @@ pub struct OpTld {
pub is_ms: bool,
pub lod_mode: TexLodMode,
pub offset: bool,
pub mem_eviction_priority: MemEvictionPriority,
pub mask: u8,
}
@ -4725,6 +4728,7 @@ impl DisplayOp for OpTld {
if self.is_ms {
write!(f, ".ms")?;
}
write!(f, "{}", self.mem_eviction_priority)?;
write!(f, " {} {} {}", self.tex, self.srcs[0], self.srcs[1])
}
}
@ -4745,6 +4749,7 @@ pub struct OpTld4 {
pub comp: u8,
pub offset_mode: Tld4OffsetMode,
pub z_cmpr: bool,
pub mem_eviction_priority: MemEvictionPriority,
pub mask: u8,
}
@ -4757,6 +4762,7 @@ impl DisplayOp for OpTld4 {
if self.z_cmpr {
write!(f, ".dc")?;
}
write!(f, "{}", self.mem_eviction_priority)?;
write!(f, " {} {} {}", self.tex, self.srcs[0], self.srcs[1])
}
}
@ -4800,6 +4806,7 @@ pub struct OpTxd {
pub dim: TexDim,
pub offset: bool,
pub mem_eviction_priority: MemEvictionPriority,
pub mask: u8,
}
@ -4809,6 +4816,7 @@ impl DisplayOp for OpTxd {
if self.offset {
write!(f, ".aoffi")?;
}
write!(f, "{}", self.mem_eviction_priority)?;
write!(f, " {} {} {}", self.tex, self.srcs[0], self.srcs[1])
}
}

View file

@ -2356,7 +2356,7 @@ impl SM70Op for OpTex {
e.set_bit(76, self.offset);
e.set_bit(77, false); // ToDo: NDV
e.set_bit(78, self.z_cmpr);
e.set_field(84..87, 1); // 0=.EF, 1=, 2=.EL, 3=.LU, 4=.EU, 5=.NA
e.set_eviction_priority(&self.mem_eviction_priority);
e.set_tex_lod_mode(87..90, self.lod_mode);
e.set_bit(90, false); // TODO: .NODEP
}
@ -2403,7 +2403,7 @@ impl SM70Op for OpTld {
self.lod_mode == TexLodMode::Zero
|| self.lod_mode == TexLodMode::Lod
);
e.set_field(84..87, 1); // 0=.EF, 1=, 2=.EL, 3=.LU, 4=.EU, 5=.NA
e.set_eviction_priority(&self.mem_eviction_priority);
e.set_tex_lod_mode(87..90, self.lod_mode);
e.set_bit(90, false); // TODO: .NODEP
}
@ -2452,7 +2452,7 @@ impl SM70Op for OpTld4 {
);
// bit 77: .CL
e.set_bit(78, self.z_cmpr);
e.set_field(84..87, 1); // 0=.EF, 1=, 2=.EL, 3=.LU, 4=.EU, 5=.NA
e.set_eviction_priority(&self.mem_eviction_priority);
e.set_field(87..89, self.comp);
e.set_bit(90, false); // TODO: .NODEP
}
@ -2530,7 +2530,7 @@ impl SM70Op for OpTxd {
e.set_field(72..76, self.mask);
e.set_bit(76, self.offset);
e.set_bit(77, false); // ToDo: NDV
e.set_field(84..87, 1); // 0=.EF, 1=, 2=.EL, 3=.LU, 4=.EU, 5=.NA
e.set_eviction_priority(&self.mem_eviction_priority);
e.set_bit(90, false); // TODO: .NODEP
}
}