fn create_converter_data_pair(
    device: &wgpu::Device,
    src_texture: &wgpu::Texture,
) -> ConverterDataPair {
    // Create the destination format texture.
    let dst_texture = wgpu::TextureBuilder::from(src_texture.descriptor_cloned())
        .sample_count(1)
        .format(Capturer::DST_FORMAT)
        .usage(wgpu::TextureUsage::OUTPUT_ATTACHMENT | wgpu::TextureUsage::COPY_SRC)
        .build(device);

    // Create the converter.
    let src_sample_count = src_texture.sample_count();
    let src_view = src_texture.create_default_view();
    let dst_sample_count = 1;
    let dst_format = dst_texture.format();
    let reshaper = wgpu::TextureReshaper::new(
        device,
        &src_view,
        src_sample_count,
        dst_sample_count,
        dst_format,
    );

    // Keep track of the `src_descriptor` to check if we need to recreate the converter.
    let src_descriptor = src_texture.descriptor_cloned();

    ConverterDataPair {
        src_descriptor,
        reshaper,
        dst_texture,
    }
}
// Create the format converter and the target texture.
Create the format converter and the target texture.
Create the format converter and the target texture .
fn create_converter_data_pair(
    device: &wgpu::Device,
    src_texture: &wgpu::Texture,
) -> ConverterDataPair {
    // Create the destination format texture.
    let dst_texture = wgpu::TextureBuilder::from(src_texture.descriptor_cloned())
        .sample_count(1)
        .format(Capturer::DST_FORMAT)
        .usage(wgpu::TextureUsage::OUTPUT_ATTACHMENT | wgpu::TextureUsage::COPY_SRC)
        .build(device);
    // Create the converter.
    let src_sample_count = src_texture.sample_count();
    let src_view = src_texture.create_default_view();
    let dst_sample_count = 1;
    let dst_format = dst_texture.format();
    let reshaper = wgpu::TextureReshaper::new(
        device,
        &src_view,
        src_sample_count,
        dst_sample_count,
        dst_format,
    );
    // Keep track of the `src_descriptor` to check if we need to recreate the converter.
    let src_descriptor = src_texture.descriptor_cloned();
    ConverterDataPair {
        src_descriptor,
        reshaper,
        dst_texture,
    }
}
fn create_converter_data_pair ( device : & wgpu :: Device , src_texture : & wgpu :: Texture , ) -> ConverterDataPair { // Create the destination format texture. let dst_texture = wgpu :: TextureBuilder :: from ( src_texture . descriptor_cloned ( ) ) . sample_count ( 1 ) . format ( Capturer :: DST_FORMAT ) . usage ( wgpu :: TextureUsage :: OUTPUT_ATTACHMENT | wgpu :: TextureUsage :: COPY_SRC ) . build ( device ) ; // Create the converter. let src_sample_count = src_texture . sample_count ( ) ; let src_view = src_texture . create_default_view ( ) ; let dst_sample_count = 1 ; let dst_format = dst_texture . format ( ) ; let reshaper = wgpu :: TextureReshaper :: new ( device , & src_view , src_sample_count , dst_sample_count , dst_format , ) ; // Keep track of the `src_descriptor` to check if we need to recreate the converter. let src_descriptor = src_texture . descriptor_cloned ( ) ; ConverterDataPair { src_descriptor , reshaper , dst_texture , } }
Create the format converter and the target texture.
Create the format converter and the target texture .
device
&wgpu::Device
src_texture
&wgpu::Texture
device
&wgpu::Device
src_texture
&wgpu::Texture