fn create_gpu_buffer(
    &self, buffer_type: BufferType, buffer_size: u64, queue_family_index: u32,
  ) -> SarektResult<(vk::Buffer, vk_mem::Allocation, vk_mem::AllocationInfo)> {
    info!("Creating GPU buffer and memory to use during drawing...");
    let buffer_usage =
      vk::BufferUsageFlags::TRANSFER_DST | usage_flags_from_buffer_type(buffer_type);
    let sharing_mode = vk::SharingMode::EXCLUSIVE;
    let queue_family_indices = [queue_family_index];
    let buffer_ci = vk::BufferCreateInfo::builder()
      .size(buffer_size)
      .usage(buffer_usage)
      .sharing_mode(sharing_mode)
      .queue_family_indices(&queue_family_indices) // Ignored if exclusive.
      .build();
    let alloc_ci = vk_mem::AllocationCreateInfo {
      usage: vk_mem::MemoryUsage::GpuOnly,
      /* All the required and preferred flags such as
       * HOST_VISIBLE, HOST_COHERENT, memory type bits, etc
       * are automagically configured by this usage flag.
       * Which works for my use case */
      ..vk_mem::AllocationCreateInfo::default()
    };

    Ok(self.allocator.create_buffer(&buffer_ci, &alloc_ci)?)
  }
/// Create a buffer with TRANSFER_DST and appropriate buffer type flags
/// flipped.
Create a buffer with TRANSFER_DST and appropriate buffer type flags
flipped.
Create a buffer with TRANSFER_DST and appropriate buffer type flags flipped .
fn create_gpu_buffer(
    &self, buffer_type: BufferType, buffer_size: u64, queue_family_index: u32,
  ) -> SarektResult<(vk::Buffer, vk_mem::Allocation, vk_mem::AllocationInfo)> {
    info!("Creating GPU buffer and memory to use during drawing...");
    let buffer_usage =
      vk::BufferUsageFlags::TRANSFER_DST | usage_flags_from_buffer_type(buffer_type);
    let sharing_mode = vk::SharingMode::EXCLUSIVE;
    let queue_family_indices = [queue_family_index];
    let buffer_ci = vk::BufferCreateInfo::builder()
      .size(buffer_size)
      .usage(buffer_usage)
      .sharing_mode(sharing_mode)
      .queue_family_indices(&queue_family_indices) // Ignored if exclusive.
      .build();
    let alloc_ci = vk_mem::AllocationCreateInfo {
      usage: vk_mem::MemoryUsage::GpuOnly,
      /* All the required and preferred flags such as
       * HOST_VISIBLE, HOST_COHERENT, memory type bits, etc
       * are automagically configured by this usage flag.
       * Which works for my use case */
      ..vk_mem::AllocationCreateInfo::default()
    };
    Ok(self.allocator.create_buffer(&buffer_ci, &alloc_ci)?)
  }
fn create_gpu_buffer ( & self , buffer_type : BufferType , buffer_size : u64 , queue_family_index : u32 , ) -> SarektResult < ( vk :: Buffer , vk_mem :: Allocation , vk_mem :: AllocationInfo ) > { info ! ( " " ) ; let buffer_usage = vk :: BufferUsageFlags :: TRANSFER_DST | usage_flags_from_buffer_type ( buffer_type ) ; let sharing_mode = vk :: SharingMode :: EXCLUSIVE ; let queue_family_indices = [ queue_family_index ] ; let buffer_ci = vk :: BufferCreateInfo :: builder ( ) . size ( buffer_size ) . usage ( buffer_usage ) . sharing_mode ( sharing_mode ) . queue_family_indices ( & queue_family_indices ) // Ignored if exclusive. . build ( ) ; let alloc_ci = vk_mem :: AllocationCreateInfo { usage : vk_mem :: MemoryUsage :: GpuOnly , /* All the required and preferred flags such as
       * HOST_VISIBLE, HOST_COHERENT, memory type bits, etc
       * are automagically configured by this usage flag.
       * Which works for my use case */ .. vk_mem :: AllocationCreateInfo :: default ( ) } ; Ok ( self . allocator . create_buffer ( & buffer_ci , & alloc_ci ) ? ) }
Create a buffer with TRANSFER_DST and appropriate buffer type flags
flipped.
Create a buffer with TRANSFER_DST and appropriate buffer type flags flipped .
&self
buffer_type
BufferType
buffer_size
u64
queue_family_index
u32
&self
buffer_type
BufferType
buffer_size
u64
queue_family_index
u32