Updated shaders and removed debug_stub_derive dependency

This commit is contained in:
Malte Veerman 2020-01-17 20:48:49 +01:00 committed by Héctor Ramón Jiménez
parent c0996923c6
commit 2f695ef980
6 changed files with 51 additions and 19 deletions

View file

@ -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,