nak: Add Src::is_unmodified() helper

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Fixes: bad23ddb48 ("nak: Add F16 and F16v2 sources")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
This commit is contained in:
Mel Henning 2025-05-02 19:34:22 -04:00 committed by Marge Bot
parent d91ba8f36d
commit 6e72f0f81b

View file

@ -1202,6 +1202,10 @@ impl Src {
b.into()
}
pub fn is_unmodified(&self) -> bool {
self.src_mod.is_none() && self.src_swizzle.is_none()
}
pub fn fabs(self) -> Src {
Src {
src_ref: self.src_ref,
@ -1241,7 +1245,7 @@ impl Src {
_ => return None,
};
if self.src_mod.is_none() && self.src_swizzle.is_none() {
if self.is_unmodified() {
return Some(u);
}