summaryrefslogtreecommitdiffstats
path: root/wgpu/src/image.rs
diff options
context:
space:
mode:
authorLibravatar Malte Veerman <malte.veerman@gmail.com>2020-01-17 20:48:49 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-25 13:27:03 +0100
commit2f695ef9803c9c08f64961f1b9902a661a385160 (patch)
tree1bdac539b758e6c101ffcb7a3312daf42b8b5036 /wgpu/src/image.rs
parentc0996923c6aab39bb61ca6d3310149c66a73fac8 (diff)
downloadiced-2f695ef9803c9c08f64961f1b9902a661a385160.tar.gz
iced-2f695ef9803c9c08f64961f1b9902a661a385160.tar.bz2
iced-2f695ef9803c9c08f64961f1b9902a661a385160.zip
Updated shaders and removed debug_stub_derive dependency
Diffstat (limited to 'wgpu/src/image.rs')
-rw-r--r--wgpu/src/image.rs32
1 files changed, 24 insertions, 8 deletions
diff --git a/wgpu/src/image.rs b/wgpu/src/image.rs
index 9443b876..2fd73b54 100644
--- a/wgpu/src/image.rs
+++ b/wgpu/src/image.rs
@@ -15,7 +15,6 @@ use std::mem;
use std::cell::RefCell;
use guillotiere::{Allocation, AtlasAllocator, Size};
-use debug_stub_derive::*;
#[derive(Debug)]
pub struct Pipeline {
@@ -477,11 +476,9 @@ impl ImageAllocation {
}
}
-#[derive(DebugStub)]
pub enum ArrayAllocation {
AtlasAllocation {
layer: usize,
- #[debug_stub = "Allocation"]
allocation: Allocation,
},
WholeLayer {
@@ -518,16 +515,35 @@ impl ArrayAllocation {
}
}
-#[derive(DebugStub)]
+impl std::fmt::Debug for ArrayAllocation {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ match self {
+ ArrayAllocation::AtlasAllocation { layer, .. } => {
+ write!(f, "ArrayAllocation::AtlasAllocation {{ layer: {} }}", layer)
+ },
+ ArrayAllocation::WholeLayer { layer } => {
+ write!(f, "ArrayAllocation::WholeLayer {{ layer: {} }}", layer)
+ }
+ }
+ }
+}
+
pub enum TextureLayer {
Whole,
- Atlas(
- #[debug_stub="AtlasAllocator"]
- AtlasAllocator
- ),
+ Atlas(AtlasAllocator),
Empty,
}
+impl std::fmt::Debug for TextureLayer {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ match self {
+ TextureLayer::Whole => write!(f, "TextureLayer::Whole"),
+ TextureLayer::Atlas(_) => write!(f, "TextureLayer::Atlas"),
+ TextureLayer::Empty => write!(f, "TextureLayer::Empty"),
+ }
+ }
+}
+
#[derive(Debug)]
pub struct TextureArray {
texture: wgpu::Texture,