pub unsafe fn allocate_memory(
        &self,
        device: &ash::Device,
        allocate_info: &vk::MemoryAllocateInfo,
    ) -> Result<(vk::DeviceMemory, AllocationId), Error> {
        let allocation = self.new_id()?;
        let memory = unsafe { device.allocate_memory(allocate_info, None) }.map_err(VkError::from)?;

        Ok((memory, allocation))
    }
/// Allocates some device memory.
///
/// This function will return [`Err`] if the maximum number of allocations is reached.
///
/// # Safety
///
/// - The caller is responsible ensuring the valid usage requirements are met for allocating memory.
/// - The caller is responsible for freeing the memory.
Allocates some device memory.
This function will return [`Err`] if the maximum number of allocations is reached.
Allocates some device memory . This function will return [ ` Err ` ] if the maximum number of allocations is reached .
pub unsafe fn allocate_memory(
        &self,
        device: &ash::Device,
        allocate_info: &vk::MemoryAllocateInfo,
    ) -> Result<(vk::DeviceMemory, AllocationId), Error> {
        let allocation = self.new_id()?;
        let memory = unsafe { device.allocate_memory(allocate_info, None) }.map_err(VkError::from)?;
        Ok((memory, allocation))
    }
pub unsafe fn allocate_memory ( & self , device : & ash :: Device , allocate_info : & vk :: MemoryAllocateInfo , ) -> Result < ( vk :: DeviceMemory , AllocationId ) , Error > { let allocation = self . new_id ( ) ? ; let memory = unsafe { device . allocate_memory ( allocate_info , None ) } . map_err ( VkError :: from ) ? ; Ok ( ( memory , allocation ) ) }
Allocates some device memory.
Allocates some device memory .
&self
device
&ash::Device
allocate_info
&vk::MemoryAllocateInfo
safety
The caller is responsible ensuring the valid usage requirements are met for allocating memory.
The caller is responsible for freeing the memory.
The caller is responsible ensuring the valid usage requirements are met for allocating memory . The caller is responsible for freeing the memory .