diff --git a/src/lib.rs b/src/lib.rs index 9942b9983b..b2ab989b9b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -773,32 +773,6 @@ pub enum SwizzleComponent { W = 3, } -impl SwizzleComponent { - pub const XYZW: [SwizzleComponent; 4] = [ - SwizzleComponent::X, - SwizzleComponent::Y, - SwizzleComponent::Z, - SwizzleComponent::W, - ]; - - pub fn index(&self) -> u32 { - match *self { - SwizzleComponent::X => 0, - SwizzleComponent::Y => 1, - SwizzleComponent::Z => 2, - SwizzleComponent::W => 3, - } - } - pub fn from_index(idx: u32) -> Self { - match idx { - 0 => SwizzleComponent::X, - 1 => SwizzleComponent::Y, - 2 => SwizzleComponent::Z, - _ => SwizzleComponent::W, - } - } -} - bitflags::bitflags! { /// Memory barrier flags. #[cfg_attr(feature = "serialize", derive(Serialize))] diff --git a/src/proc/mod.rs b/src/proc/mod.rs index 6229f9390a..a524981f55 100644 --- a/src/proc/mod.rs +++ b/src/proc/mod.rs @@ -267,3 +267,24 @@ impl std::hash::Hash for crate::ScalarValue { } } } + +impl super::SwizzleComponent { + pub const XYZW: [Self; 4] = [Self::X, Self::Y, Self::Z, Self::W]; + + pub fn index(&self) -> u32 { + match *self { + Self::X => 0, + Self::Y => 1, + Self::Z => 2, + Self::W => 3, + } + } + pub fn from_index(idx: u32) -> Self { + match idx { + 0 => Self::X, + 1 => Self::Y, + 2 => Self::Z, + _ => Self::W, + } + } +}