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>
(cherry picked from commit 6e72f0f81b05a02341fb68c9d6de96c33ec5ca96)
This commit is contained in:
Mel Henning
2025-05-02 19:34:22 -04:00
committed by Eric Engestrom
parent 0ce1adf683
commit 81b877c9a0
2 changed files with 6 additions and 2 deletions

View File

@@ -104,7 +104,7 @@
"description": "nak: Add Src::is_unmodified() helper",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "bad23ddb4849908a648d503a615a5a9b15e9768a",
"notes": null

View File

@@ -1094,6 +1094,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,
@@ -1131,7 +1135,7 @@ impl Src {
return *self;
};
if self.src_mod.is_none() && self.src_swizzle.is_none() {
if self.is_unmodified() {
return *self;
}