pub fn new(queue: ArcVulkanQueue, count: usize, buffer_size: usize) -> Self {
        let buffers = (0..count)
            .map(|_| {
                let vd = queue.vd().clone();
                let pool = CommandPool::new(queue.clone(), CommandPoolCreateFlags::empty());
                let command_buffer = pool.alloc_one_raw(true);
                let buffer = GpuBuffer::new(
                    vd.clone(),
                    buffer_size,
                    BufferUsage::TransferSrc,
                    VmaMemoryUsageType::CpuOnly,
                    false,
                    true,
                );
                // let fence = Fence::new(vd.clone(), false).unwrap();

                StagingBuffer {
                    pool,
                    command_buffer,
                    buffer,
                    // fence,
                    submitted: false,
                    size: buffer_size,
                    current_offset: 0,
                    queue: queue.clone(),
                    borrowed: AtomicBool::new(false),
                }
            })
            .collect::<SVec4<StagingBuffer>>();

        Self {
            current: 0,
            count,
            buffers,
            buffer_size,
            queue,
        }
    }
/// Create a new staging buffer pool.
/// It is recommended to use Vulkan's transfer queue.
Create a new staging buffer pool.
It is recommended to use Vulkan's transfer queue.
Create a new staging buffer pool . It is recommended to use Vulkan ' s transfer queue .
pub fn new(queue: ArcVulkanQueue, count: usize, buffer_size: usize) -> Self {
        let buffers = (0..count)
            .map(|_| {
                let vd = queue.vd().clone();
                let pool = CommandPool::new(queue.clone(), CommandPoolCreateFlags::empty());
                let command_buffer = pool.alloc_one_raw(true);
                let buffer = GpuBuffer::new(
                    vd.clone(),
                    buffer_size,
                    BufferUsage::TransferSrc,
                    VmaMemoryUsageType::CpuOnly,
                    false,
                    true,
                );
                // let fence = Fence::new(vd.clone(), false).unwrap();
                StagingBuffer {
                    pool,
                    command_buffer,
                    buffer,
                    // fence,
                    submitted: false,
                    size: buffer_size,
                    current_offset: 0,
                    queue: queue.clone(),
                    borrowed: AtomicBool::new(false),
                }
            })
            .collect::<SVec4<StagingBuffer>>();
        Self {
            current: 0,
            count,
            buffers,
            buffer_size,
            queue,
        }
    }
pub fn new ( queue : ArcVulkanQueue , count : usize , buffer_size : usize ) -> Self { let buffers = ( 0 .. count ) . map ( | _ | { let vd = queue . vd ( ) . clone ( ) ; let pool = CommandPool :: new ( queue . clone ( ) , CommandPoolCreateFlags :: empty ( ) ) ; let command_buffer = pool . alloc_one_raw ( true ) ; let buffer = GpuBuffer :: new ( vd . clone ( ) , buffer_size , BufferUsage :: TransferSrc , VmaMemoryUsageType :: CpuOnly , false , true , ) ; // let fence = Fence::new(vd.clone(), false).unwrap(); StagingBuffer { pool , command_buffer , buffer , // fence, submitted : false , size : buffer_size , current_offset : 0 , queue : queue . clone ( ) , borrowed : AtomicBool :: new ( false ) , } } ) . collect :: < SVec4 < StagingBuffer > > ( ) ; Self { current : 0 , count , buffers , buffer_size , queue , } }
Create a new staging buffer pool.
Create a new staging buffer pool .
queue
ArcVulkanQueue
count
usize
buffer_size
usize
queue
ArcVulkanQueue
count
usize
buffer_size
usize