From 29d731f902c6ab0fb34007c51e319ad6291c2d01 Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Tue, 17 Mar 2020 12:53:13 +0100 Subject: [PATCH 1/2] Add `Clone` and `PartialEq` derives for `Texture(View)Descriptor` I've come across use cases for these in nannou so thought I would add them! --- wgpu-types/src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/wgpu-types/src/lib.rs b/wgpu-types/src/lib.rs index 8330ba9f47..d7cd3dc99b 100644 --- a/wgpu-types/src/lib.rs +++ b/wgpu-types/src/lib.rs @@ -556,18 +556,18 @@ pub type DynamicOffset = u32; #[repr(C)] #[derive(Copy, Clone, Debug)] pub enum PresentMode { - /// The presentation engine does **not** wait for a vertical blanking period and + /// The presentation engine does **not** wait for a vertical blanking period and /// the request is presented immediately. This is a low-latency presentation mode, /// but visible tearing may be observed. Will fallback to `Fifo` if unavailable on the - /// selected platform and backend. Not optimal for mobile. + /// selected platform and backend. Not optimal for mobile. Immediate = 0, /// The presentation engine waits for the next vertical blanking period to update - /// the current image, but frames may be submitted without delay. This is a low-latency + /// the current image, but frames may be submitted without delay. This is a low-latency /// presentation mode and visible tearing will **not** be observed. Will fallback to `Fifo` /// if unavailable on the selected platform and backend. Not optimal for mobile. Mailbox = 1, - /// The presentation engine waits for the next vertical blanking period to update - /// the current image. The framerate will be capped at the display refresh rate, + /// The presentation engine waits for the next vertical blanking period to update + /// the current image. The framerate will be capped at the display refresh rate, /// corresponding to the `VSync`. Tearing cannot be observed. Optimal for mobile. Fifo = 2, } @@ -731,7 +731,7 @@ pub struct Extent3d { } #[repr(C)] -#[derive(Debug)] +#[derive(Clone, Debug, PartialEq)] pub struct TextureDescriptor { pub size: Extent3d, pub array_layer_count: u32, @@ -757,7 +757,7 @@ impl Default for TextureAspect { } #[repr(C)] -#[derive(Debug)] +#[derive(Clone, Debug, PartialEq)] pub struct TextureViewDescriptor { pub format: TextureFormat, pub dimension: TextureViewDimension, From f00ab00ad9405577c9728da9b962a6943a3efe51 Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Tue, 17 Mar 2020 13:05:13 +0100 Subject: [PATCH 2/2] Add derive PartialEq to Extent3d --- wgpu-types/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wgpu-types/src/lib.rs b/wgpu-types/src/lib.rs index d7cd3dc99b..33566b7083 100644 --- a/wgpu-types/src/lib.rs +++ b/wgpu-types/src/lib.rs @@ -723,7 +723,7 @@ impl Default for Origin3d { } #[repr(C)] -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, PartialEq)] pub struct Extent3d { pub width: u32, pub height: u32,