aboutsummaryrefslogtreecommitdiff
path: root/stockton-skeleton/src/utils.rs
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:24 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:24 +0100
commitb86e97f67a07368877bd18501aebcbe80cf93118 (patch)
tree97b72b4339da6400b481170eab11fd89ab5dfa80 /stockton-skeleton/src/utils.rs
parente1cc0e9a9d191bcd3a634be46fd3555d430b07a8 (diff)
feat(skeleton): add memory pools
added stock memory pools behind a feature gate refactored buffers to use them and to have better APIs. moved some util code out of builders::pipeline updated stockton-render for the changes deactivation is a WIP breaks UI drawing, fix WIP
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
+}