aboutsummaryrefslogtreecommitdiff
path: root/stockton-skeleton/src/utils.rs
diff options
context:
space:
mode:
Diffstat (limited to 'stockton-skeleton/src/utils.rs')
-rw-r--r--stockton-skeleton/src/utils.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/stockton-skeleton/src/utils.rs b/stockton-skeleton/src/utils.rs
index 152ba10..253ad7f 100644
--- a/stockton-skeleton/src/utils.rs
+++ b/stockton-skeleton/src/utils.rs
@@ -1,5 +1,5 @@
use crate::types::*;
-use hal::{memory::Properties as MemProperties, MemoryTypeId};
+use hal::{format::Format, memory::Properties as MemProperties, MemoryTypeId};
pub fn find_memory_type_id(
adapter: &Adapter,
@@ -17,3 +17,7 @@ pub fn find_memory_type_id(
})
.map(|(id, _)| MemoryTypeId(id))
}
+
+pub fn get_pixel_size(f: Format) -> u32 {
+ f.surface_desc().bits as u32 / 8
+}