mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-21 03:48:22 +02:00
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:
parent
162d7091e9
commit
04e3afaac8
1 changed files with 4 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue