fn try_enqueue_existing_buffer_upload(
        device_context: &RafxDeviceContext,
        upload: &mut RafxTransferUpload,
        pending_buffer: PendingExistingBufferUpload,
        in_flight_uploads: &mut Vec<InFlightUpload>,
    ) -> RafxResult<Option<PendingExistingBufferUpload>> {
        let result = buffer_upload::enqueue_load_buffer(
            device_context,
            upload,
            pending_buffer.resource_type,
            // self.transfer_queue.queue_family_index(),
            // self.graphics_queue.queue_family_index(),
            &pending_buffer.data,
            Some(&*pending_buffer.dst_buffer.get_raw().buffer),
            pending_buffer.dst_byte_offset,
        );

        match result {
            Ok(buffer) => {
                //It should be none, we used an existing buffer
                assert!(buffer.is_none());
                in_flight_uploads.push(InFlightUpload::ExistingResource(
                    InFlightExistingResourceUpload {
                        upload_op: pending_buffer.upload_op,
                    },
                ));
                Ok(None)
            }
            Err(RafxUploadError::Other(e)) => Err(e),
            Err(RafxUploadError::BufferFull) => Ok(Some(pending_buffer)),
        }
    }
// Ok(None) = upload enqueue
// Ok(Some) = upload not enqueued because there was not enough room
// Err = Vulkan error
Ok(None) = upload enqueue
Ok(Some) = upload not enqueued because there was not enough room
Err = Vulkan error
Ok ( None ) = upload enqueue Ok ( Some ) = upload not enqueued because there was not enough room Err = Vulkan error
fn try_enqueue_existing_buffer_upload(
        device_context: &RafxDeviceContext,
        upload: &mut RafxTransferUpload,
        pending_buffer: PendingExistingBufferUpload,
        in_flight_uploads: &mut Vec<InFlightUpload>,
    ) -> RafxResult<Option<PendingExistingBufferUpload>> {
        let result = buffer_upload::enqueue_load_buffer(
            device_context,
            upload,
            pending_buffer.resource_type,
            // self.transfer_queue.queue_family_index(),
            // self.graphics_queue.queue_family_index(),
            &pending_buffer.data,
            Some(&*pending_buffer.dst_buffer.get_raw().buffer),
            pending_buffer.dst_byte_offset,
        );
        match result {
            Ok(buffer) => {
                //It should be none, we used an existing buffer
                assert!(buffer.is_none());
                in_flight_uploads.push(InFlightUpload::ExistingResource(
                    InFlightExistingResourceUpload {
                        upload_op: pending_buffer.upload_op,
                    },
                ));
                Ok(None)
            }
            Err(RafxUploadError::Other(e)) => Err(e),
            Err(RafxUploadError::BufferFull) => Ok(Some(pending_buffer)),
        }
    }
fn try_enqueue_existing_buffer_upload ( device_context : & RafxDeviceContext , upload : & mut RafxTransferUpload , pending_buffer : PendingExistingBufferUpload , in_flight_uploads : & mut Vec < InFlightUpload > , ) -> RafxResult < Option < PendingExistingBufferUpload > > { let result = buffer_upload :: enqueue_load_buffer ( device_context , upload , pending_buffer . resource_type , // self.transfer_queue.queue_family_index(), // self.graphics_queue.queue_family_index(), & pending_buffer . data , Some ( & * pending_buffer . dst_buffer . get_raw ( ) . buffer ) , pending_buffer . dst_byte_offset , ) ; match result { Ok ( buffer ) => { //It should be none, we used an existing buffer assert ! ( buffer is_none ( ) ) ; in_flight_uploads . push ( InFlightUpload :: ExistingResource ( InFlightExistingResourceUpload { upload_op : pending_buffer . upload_op , } , ) ) ; Ok ( None ) } Err ( RafxUploadError :: Other ( e ) ) => Err ( e ) , Err ( RafxUploadError :: BufferFull ) => Ok ( Some ( pending_buffer ) ) , } }
Ok(None) = upload enqueue
Ok(Some) = upload not enqueued because there was not enough room
Err = Vulkan error
Ok ( None ) = upload enqueue Ok ( Some ) = upload not enqueued because there was not enough room Err = Vulkan error
device_context
&RafxDeviceContext
upload
&mut RafxTransferUpload
pending_buffer
PendingExistingBufferUpload
in_flight_uploads
&mut Vec<InFlightUpload>
device_context
&RafxDeviceContext
upload
&mut RafxTransferUpload
pending_buffer
PendingExistingBufferUpload
in_flight_uploads
&mut Vec<InFlightUpload>