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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user