From bc6f4a2b3529d749bef807478c3541a0618625bb Mon Sep 17 00:00:00 2001 From: janis Date: Wed, 1 Apr 2026 23:31:55 +0200 Subject: [PATCH] add getter for vulkan::Allocation::memory_type_index --- src/vulkan/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) 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