nak: Rework printing of TexLodMode

Puth the "." in the Display implementation like other modifiers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35795>
This commit is contained in:
Faith Ekstrand 2025-06-27 09:33:42 -04:00 committed by Marge Bot
parent 59f4c8dac2
commit cb9e458d29

View file

@ -1930,12 +1930,12 @@ impl TexLodMode {
impl fmt::Display for TexLodMode { impl fmt::Display for TexLodMode {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self { match self {
TexLodMode::Auto => write!(f, "la"), TexLodMode::Auto => write!(f, ""),
TexLodMode::Zero => write!(f, "lz"), TexLodMode::Zero => write!(f, ".lz"),
TexLodMode::Bias => write!(f, "lb"), TexLodMode::Bias => write!(f, ".lb"),
TexLodMode::Lod => write!(f, "ll"), TexLodMode::Lod => write!(f, ".ll"),
TexLodMode::Clamp => write!(f, "lc"), TexLodMode::Clamp => write!(f, ".lc"),
TexLodMode::BiasClamp => write!(f, "lb.lc"), TexLodMode::BiasClamp => write!(f, ".lb.lc"),
} }
} }
} }
@ -5122,11 +5122,7 @@ pub struct OpTex {
impl DisplayOp for OpTex { impl DisplayOp for OpTex {
fn fmt_op(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt_op(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "tex{}", self.dim)?; write!(f, "tex{}{}{}", self.dim, self.lod_mode, self.offset_mode)?;
if self.lod_mode != TexLodMode::Auto {
write!(f, ".{}", self.lod_mode)?;
}
write!(f, "{}", self.offset_mode)?;
if self.z_cmpr { if self.z_cmpr {
write!(f, ".dc")?; write!(f, ".dc")?;
} }
@ -5162,11 +5158,7 @@ pub struct OpTld {
impl DisplayOp for OpTld { impl DisplayOp for OpTld {
fn fmt_op(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt_op(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "tld{}", self.dim)?; write!(f, "tld{}{}{}", self.dim, self.lod_mode, self.offset_mode)?;
if self.lod_mode != TexLodMode::Auto {
write!(f, ".{}", self.lod_mode)?;
}
write!(f, "{}", self.offset_mode)?;
if self.is_ms { if self.is_ms {
write!(f, ".ms")?; write!(f, ".ms")?;
} }