diff --git a/crates/bevy_image/src/image.rs b/crates/bevy_image/src/image.rs index 5260c70bfc..e0c7939ca1 100644 --- a/crates/bevy_image/src/image.rs +++ b/crates/bevy_image/src/image.rs @@ -358,7 +358,7 @@ pub struct Image { /// Used in [`Image`], this determines what image sampler to use when rendering. The default setting, /// [`ImageSampler::Default`], will read the sampler from the `ImagePlugin` at setup. /// Setting this to [`ImageSampler::Descriptor`] will override the global default descriptor for this [`Image`]. -#[derive(Debug, Default, Clone, Serialize, Deserialize)] +#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub enum ImageSampler { /// Default image sampler, derived from the `ImagePlugin` setup. #[default] @@ -403,7 +403,7 @@ impl ImageSampler { /// See [`ImageSamplerDescriptor`] for information how to configure this. /// /// This type mirrors [`AddressMode`]. -#[derive(Clone, Copy, Debug, Default, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize)] pub enum ImageAddressMode { /// Clamp the value to the edge of the texture. /// @@ -432,7 +432,7 @@ pub enum ImageAddressMode { /// Texel mixing mode when sampling between texels. /// /// This type mirrors [`FilterMode`]. -#[derive(Clone, Copy, Debug, Default, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize)] pub enum ImageFilterMode { /// Nearest neighbor sampling. /// @@ -448,7 +448,7 @@ pub enum ImageFilterMode { /// Comparison function used for depth and stencil operations. /// /// This type mirrors [`CompareFunction`]. -#[derive(Clone, Copy, Debug, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)] pub enum ImageCompareFunction { /// Function never passes Never, @@ -475,7 +475,7 @@ pub enum ImageCompareFunction { /// Color variation to use when the sampler addressing mode is [`ImageAddressMode::ClampToBorder`]. /// /// This type mirrors [`SamplerBorderColor`]. -#[derive(Clone, Copy, Debug, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)] pub enum ImageSamplerBorderColor { /// RGBA color `[0, 0, 0, 0]`. TransparentBlack, @@ -498,7 +498,7 @@ pub enum ImageSamplerBorderColor { /// a breaking change. /// /// This types mirrors [`SamplerDescriptor`], but that might change in future versions. -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageSamplerDescriptor { pub label: Option, /// How to deal with out of bounds accesses in the u (i.e. x) direction.