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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42274>
This commit is contained in:
Faith Ekstrand 2026-06-16 10:45:19 -04:00 committed by Marge Bot
parent 162d7091e9
commit 04e3afaac8

View file

@ -578,6 +578,10 @@ impl Swizzle {
/// Applies this swizzle to a u32 value
pub fn fold_u32(&self, u: u32) -> Option<u32> {
if self.is_none() {
return Some(u);
}
let mut folded = 0_u32;
let mut has_fext = false;
for i in 0..4 {