Stop creating image pipeline when unnecessary
This commit is contained in:
parent
fc55e3a3df
commit
4e7159c22c
11 changed files with 114 additions and 86 deletions
26
wgpu/src/image/atlas/entry.rs
Normal file
26
wgpu/src/image/atlas/entry.rs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
use crate::image::atlas;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Entry {
|
||||
Contiguous(atlas::Allocation),
|
||||
Fragmented {
|
||||
size: (u32, u32),
|
||||
fragments: Vec<Fragment>,
|
||||
},
|
||||
}
|
||||
|
||||
impl Entry {
|
||||
#[cfg(feature = "image")]
|
||||
pub fn size(&self) -> (u32, u32) {
|
||||
match self {
|
||||
Entry::Contiguous(allocation) => allocation.size(),
|
||||
Entry::Fragmented { size, .. } => *size,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Fragment {
|
||||
pub position: (u32, u32),
|
||||
pub allocation: atlas::Allocation,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue