fn try_enqueue_image_upload(
        &mut self,
        upload: &mut VkTransferUpload,
        pending_image: PendingImageUpload,
        in_flight_uploads: &mut Vec<InFlightImageUpload>,
    ) -> VkResult<Option<PendingImageUpload>> {
        let result = image_upload::enqueue_load_image(
            &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_image.texture,
        );

        match result {
            Ok(image) => {
                in_flight_uploads.push(InFlightImageUpload {
                    image,
                    load_op: pending_image.load_op,
                    upload_op: pending_image.upload_op,
                });
                Ok(None)
            }
            Err(VkUploadError::VkError(e)) => Err(e),
            Err(VkUploadError::BufferFull) => Ok(Some(pending_image)),
        }
    }
// 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_image_upload(
        &mut self,
        upload: &mut VkTransferUpload,
        pending_image: PendingImageUpload,
        in_flight_uploads: &mut Vec<InFlightImageUpload>,
    ) -> VkResult<Option<PendingImageUpload>> {
        let result = image_upload::enqueue_load_image(
            &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_image.texture,
        );
        match result {
            Ok(image) => {
                in_flight_uploads.push(InFlightImageUpload {
                    image,
                    load_op: pending_image.load_op,
                    upload_op: pending_image.upload_op,
                });
                Ok(None)
            }
            Err(VkUploadError::VkError(e)) => Err(e),
            Err(VkUploadError::BufferFull) => Ok(Some(pending_image)),
        }
    }
fn try_enqueue_image_upload ( & mut self , upload : & mut VkTransferUpload , pending_image : PendingImageUpload , in_flight_uploads : & mut Vec < InFlightImageUpload > , ) -> VkResult < Option < PendingImageUpload > > { let result = image_upload :: enqueue_load_image ( & 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_image . texture , ) ; match result { Ok ( image ) => { in_flight_uploads . push ( InFlightImageUpload { image , load_op : pending_image . load_op , upload_op : pending_image . upload_op , } ) ; Ok ( None ) } Err ( VkUploadError :: VkError ( e ) ) => Err ( e ) , Err ( VkUploadError :: BufferFull ) => Ok ( Some ( pending_image ) ) , } }
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_image
PendingImageUpload
in_flight_uploads
&mut Vec<InFlightImageUpload>
&mut self
upload
&mut VkTransferUpload
pending_image
PendingImageUpload
in_flight_uploads
&mut Vec<InFlightImageUpload>