fn try_enqueue_buffer_upload(
        &mut self,
        upload: &mut VkTransferUpload,
        pending_buffer: PendingBufferUpload,
        in_flight_uploads: &mut Vec<InFlightBufferUpload>,
    ) -> VkResult<Option<PendingBufferUpload>> {
        let result = buffer_upload::enqueue_load_buffer(
            &self.device_context,
            upload,
            self.device_context
                .queue_family_indices()
                .transfer_queue_family_index,
            self.device_context
                .queue_family_indices()
                .graphics_queue_family_index,
            &pending_buffer.data,
        );

        match result {
            Ok(buffer) => {
                in_flight_uploads.push(InFlightBufferUpload {
                    buffer,
                    load_op: pending_buffer.load_op,
                    upload_op: pending_buffer.upload_op,
                });
                Ok(None)
            }
            Err(VkUploadError::VkError(e)) => Err(e),
            Err(VkUploadError::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_buffer_upload(
        &mut self,
        upload: &mut VkTransferUpload,
        pending_buffer: PendingBufferUpload,
        in_flight_uploads: &mut Vec<InFlightBufferUpload>,
    ) -> VkResult<Option<PendingBufferUpload>> {
        let result = buffer_upload::enqueue_load_buffer(
            &self.device_context,
            upload,
            self.device_context
                .queue_family_indices()
                .transfer_queue_family_index,
            self.device_context
                .queue_family_indices()
                .graphics_queue_family_index,
            &pending_buffer.data,
        );
        match result {
            Ok(buffer) => {
                in_flight_uploads.push(InFlightBufferUpload {
                    buffer,
                    load_op: pending_buffer.load_op,
                    upload_op: pending_buffer.upload_op,
                });
                Ok(None)
            }
            Err(VkUploadError::VkError(e)) => Err(e),
            Err(VkUploadError::BufferFull) => Ok(Some(pending_buffer)),
        }
    }
fn try_enqueue_buffer_upload ( & mut self , upload : & mut VkTransferUpload , pending_buffer : PendingBufferUpload , in_flight_uploads : & mut Vec < InFlightBufferUpload > , ) -> VkResult < Option < PendingBufferUpload > > { let result = buffer_upload :: enqueue_load_buffer ( & self . device_context , upload , self . device_context . queue_family_indices ( ) . transfer_queue_family_index , self . device_context . queue_family_indices ( ) . graphics_queue_family_index , & pending_buffer . data , ) ; match result { Ok ( buffer ) => { in_flight_uploads . push ( InFlightBufferUpload { buffer , load_op : pending_buffer . load_op , upload_op : pending_buffer . upload_op , } ) ; Ok ( None ) } Err ( VkUploadError :: VkError ( e ) ) => Err ( e ) , Err ( VkUploadError :: 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
&mut self
upload
&mut VkTransferUpload
pending_buffer
PendingBufferUpload
in_flight_uploads
&mut Vec<InFlightBufferUpload>
&mut self
upload
&mut VkTransferUpload
pending_buffer
PendingBufferUpload
in_flight_uploads
&mut Vec<InFlightBufferUpload>