allocate_buffer_memory

Function allocate_buffer_memory 

Source
pub unsafe fn allocate_buffer_memory(
    device: VkDevice,
    buffer: VkBuffer,
    pool_type: PoolType,
) -> Result<u64, IcdError>
Expand description

Helper to allocate buffer memory

ยงSafety

This function is unsafe because:

  • Both device and buffer must be valid Vulkan handles
  • Calls vkGetBufferMemoryRequirements and vkBindBufferMemory
  • The buffer must not already have memory bound
  • The pool type must be compatible with buffer usage
  • On failure, the allocation is automatically freed
  • The returned allocation ID owns the memory binding