summaryrefslogtreecommitdiffstats
path: root/wgpu/src/image/atlas/layer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'wgpu/src/image/atlas/layer.rs')
-rw-r--r--wgpu/src/image/atlas/layer.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/wgpu/src/image/atlas/layer.rs b/wgpu/src/image/atlas/layer.rs
index cf089601..fd6788d9 100644
--- a/wgpu/src/image/atlas/layer.rs
+++ b/wgpu/src/image/atlas/layer.rs
@@ -11,4 +11,12 @@ impl Layer {
pub fn is_empty(&self) -> bool {
matches!(self, Layer::Empty)
}
+
+ pub fn allocations(&self) -> usize {
+ match self {
+ Layer::Empty => 0,
+ Layer::Busy(allocator) => allocator.allocations(),
+ Layer::Full => 1,
+ }
+ }
}