From 04e3afaac8fdb92bb6eb9380f3ee88fc13b969f6 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Tue, 16 Jun 2026 10:45:19 -0400 Subject: [PATCH] kraid/swizzle: Add an is_none() special case in fold_u32() This does nothing since NONE is B0123 but it makes the folding code clearer and probably a bit faster for a common case. Part-of: --- src/panfrost/compiler/kraid/swizzle.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/panfrost/compiler/kraid/swizzle.rs b/src/panfrost/compiler/kraid/swizzle.rs index b8ec9cfe57c..1b6196449c6 100644 --- a/src/panfrost/compiler/kraid/swizzle.rs +++ b/src/panfrost/compiler/kraid/swizzle.rs @@ -578,6 +578,10 @@ impl Swizzle { /// Applies this swizzle to a u32 value pub fn fold_u32(&self, u: u32) -> Option { + if self.is_none() { + return Some(u); + } + let mut folded = 0_u32; let mut has_fext = false; for i in 0..4 {