pub fn load_texture_from_image(
    device: &wgpu::Device,
    queue: &mut wgpu::Queue,
    usage: wgpu::TextureUsage,
    image: &image::DynamicImage,
) -> wgpu::Texture {
    let cmd_encoder_desc = wgpu::CommandEncoderDescriptor::default();
    let mut encoder = device.create_command_encoder(&cmd_encoder_desc);
    let texture = encode_load_texture_from_image(device, &mut encoder, usage, image);
    queue.submit(&[encoder.finish()]);
    texture
}
/// Load a texture directly from a dynamic image.
///
/// If the image is already in a format supported by wgpu, no conversions are performed and the
/// image is loaded directly as-is with a texture format that matches the original image color
/// type.
///
/// If the image is of an unsupported format, it will be converted to the closest supported format
/// before being uploaded.
Load a texture directly from a dynamic image.
If the image is already in a format supported by wgpu, no conversions are performed and the
image is loaded directly as-is with a texture format that matches the original image color
type.

If the image is of an unsupported format, it will be converted to the closest supported format
before being uploaded.
Load a texture directly from a dynamic image . If the image is already in a format supported by wgpu no conversions are performed and the image is loaded directly as - is with a texture format that matches the original image color type . If the image is of an unsupported format it will be converted to the closest supported format before being uploaded .
pub fn load_texture_from_image(
    device: &wgpu::Device,
    queue: &mut wgpu::Queue,
    usage: wgpu::TextureUsage,
    image: &image::DynamicImage,
) -> wgpu::Texture {
    let cmd_encoder_desc = wgpu::CommandEncoderDescriptor::default();
    let mut encoder = device.create_command_encoder(&cmd_encoder_desc);
    let texture = encode_load_texture_from_image(device, &mut encoder, usage, image);
    queue.submit(&[encoder.finish()]);
    texture
}
pub fn load_texture_from_image ( device : & wgpu :: Device , queue : & mut wgpu :: Queue , usage : wgpu :: TextureUsage , image : & image :: DynamicImage , ) -> wgpu :: Texture { let cmd_encoder_desc = wgpu :: CommandEncoderDescriptor :: default ( ) ; let mut encoder = device . create_command_encoder ( & cmd_encoder_desc ) ; let texture = encode_load_texture_from_image ( device , & mut encoder , usage , image ) ; queue . submit ( & [ encoder . finish ( ) ] ) ; texture }
Load a texture directly from a dynamic image.
Load a texture directly from a dynamic image .
device
&wgpu::Device
queue
&mut wgpu::Queue
usage
wgpu::TextureUsage
image
&image::DynamicImage
device
&wgpu::Device
queue
&mut wgpu::Queue
usage
wgpu::TextureUsage
image
&image::DynamicImage