diff --git a/src/vulkan/mod.rs b/src/vulkan/mod.rs index 59572d4..cf729b5 100644 --- a/src/vulkan/mod.rs +++ b/src/vulkan/mod.rs @@ -208,6 +208,15 @@ impl Allocation { self.chunk_id } + /// Returns the index into the `memory_types` array of + /// `vk::PhysicalDeviceMemoryProperties` of the memory type that this + /// allocation is using. + /// This can be useful when trying to bind this allocation to a resource + /// with specific memory requirements. + pub fn memory_type_index(&self) -> usize { + self.memory_type_index + } + ///Returns the [`vk::MemoryPropertyFlags`] of this allocation. pub fn memory_properties(&self) -> vk::MemoryPropertyFlags { self.memory_properties