You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: blit.rs
    path of file: ./repos/Ambient/crates/gpu/src
    
    the code of the file until where you have to start completion: use std::sync::Arc;

use ambient_native_std::asset_cache::{AssetCache, SyncAssetKey, SyncAssetKeyExt};
use wgpu::{
    BindGroupLayoutDescriptor, BindGroupLayoutEntry, FilterMode, PipelineLayoutDescriptor,
    ShaderStages, TextureSampleType,
};

use crate::shader_module::{Shader, ShaderIdent, ShaderModule};

use super::gpu::{Gpu, GpuKey};

#[derive(Debug, Clone)]
pub struct BlitterKey {
    pub format: wgpu::ColorTargetState,
    pub min_filter: FilterMode,
    pub gamma_correction: Option<f32>,
}

impl SyncAssetKey<Arc<Blitter>> for BlitterKey {
    fn load(&self, assets: AssetCache) -> Arc<Blitter> {
        let gpu = GpuKey.get(&assets);
        Arc::new(Blitter::new(&gpu, &assets, self))
    }
}

pub struct Blitter {
    pipeline: wgpu::RenderPipeline,
    sampler: wgpu::Sampler,
}
impl Blitter {
    pub fn new(gpu: &Gpu, assets: &AssetCache, conf: &BlitterKey) -> Self {
        tracing::debug!("Creating blitter: {conf:#?}");
        let colorspace = if let Some(gamma) = conf.gamma_correction {
            let inv_gamma = 1.0 / gamma;
            format!("vec4<f32>(pow(color.xyz, vec3<f32>({inv_gamma})), color.w)")
        } else {
            "color".to_string()
        };

        let shader = Shader::new(
            assets,
            "blitter",
            &[],
            &ShaderModule::new("blitter", include_str!("blit.wgsl"))
                .with_ident(ShaderIdent::raw("COLORSPACE_EXPR", colorspace)),
        )
        .unwrap();

        let bind_group_layout = gpu
            .device
            .create_bind_group_layout(&BindGroupLayoutDescriptor {
                label: Some("blitter.bind_group_layout"),
                entries: &[
                    BindGroupLayoutEntry {
                        binding: 0,
                        visibility: ShaderStages::FRAGMENT,
                        ty: wgpu::BindingType::Texture {
                            sample_type: TextureSampleType::Float { filterable: true },
                            view_dimension: wgpu::TextureViewDimension::D2,
                            multisampled: false,
                        },
                        count: None,
                    },
                    BindGroupLayoutEntry {
                        binding: 1,
                        visibility: ShaderStages::FRAGMENT,
                        ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::Filtering),
                        count: None,
                    },
                ],
            });

        let layout = gpu
            .device
            .create_pipeline_layout(&PipelineLayoutDescriptor {
                label: Some("blitter.layout"),
                bind_group_layouts: &[&bind_group_layout],
                push_constant_ranges: &[],
            });

        tracing::debug!("Setting up blitter");
        let pipeline = gpu
            .device
            .create_render_pipeline(&wgpu::RenderPipelineDescriptor {
                label: Some("Blitter.pipeline"),
                layout: Some(&layout),
                vertex: wgpu::VertexState {
                    module: &shader,
                    entry_point: "vs_main",
                    buffers: &[],
                },
                fragment: Some(wgpu::FragmentState {
                    module: &shader,
                    entry_point
    
    pub fn new(gpu: &Gpu, assets: &AssetCache, conf: &BlitterKey) -> Self {
        tracing::debug!("Creating blitter: {conf:#?}");
        let colorspace = if let Some(gamma) = conf.gamma_correction {
            let inv_gamma = 1.0 / gamma;
            format!("vec4<f32>(pow(color.xyz, vec3<f32>({inv_gamma})), color.w)")
        } else {
            "color".to_string()
        };

        let shader = Shader::new(
            assets,
            "blitter",
            &[],
            &ShaderModule::new("blitter", include_str!("blit.wgsl"))
                .with_ident(ShaderIdent::raw("COLORSPACE_EXPR", colorspace)),
        )
        .unwrap();

        let bind_group_layout = gpu
            .device
            .create_bind_group_layout(&BindGroupLayoutDescriptor {
                label: Some("blitter.bind_group_layout"),
                entries: &[
                    BindGroupLayoutEntry {
                        binding: 0,
                        visibility: ShaderStages::FRAGMENT,
                        ty: wgpu::BindingType::Texture {
                            sample_type: TextureSampleType::Float { filterable: true },
                            view_dimension: wgpu::TextureViewDimension::D2,
                            multisampled: false,
                        },
                        count: None,
                    },
                    BindGroupLayoutEntry {
                        binding: 1,
                        visibility: ShaderStages::FRAGMENT,
                        ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::Filtering),
                        count: None,
                    },
                ],
            });

        let layout = gpu
            .device
            .create_pipeline_layout(&PipelineLayoutDescriptor {
                label: Some("blitter.layout"),
                bind_group_layouts: &[&bind_group_layout],
                push_constant_ranges: &[],
            });

        tracing::debug!("Setting up blitter");
        let pipeline = gpu
            .device
            .create_render_pipeline(&wgpu::RenderPipelineDescriptor {
                label: Some("Blitter.pipeline"),
                layout: Some(&layout),
                vertex: wgpu::VertexState {
                    module: &shader,
                    entry_point: "vs_main",
                    buffers: &[],
                },
                fragment: Some(wgpu::FragmentState {
                    module: &shader,
                    entry_point: "fs_main",
                    targets: &[Some(conf.format.clone())],
                }),
                primitive: wgpu::PrimitiveState {
                    topology: wgpu::PrimitiveTopology::TriangleStrip,
                    ..Default::default()
                },
                depth_stencil: None,
                multisample: wgpu::MultisampleState::default(),
                multiview: None,
            });

        let sampler = gpu.device.create_sampler(&wgpu::SamplerDescriptor {
            label: Some("Blitter.sampler"),
            address_mode_u: wgpu::AddressMode::ClampToEdge,
            address_mode_v: wgpu::AddressMode::ClampToEdge,
            address_mode_w: wgpu::AddressMode::ClampToEdge,
            mag_filter: wgpu::FilterMode::Linear,
            min_filter: conf.min_filter,
            mipmap_filter: wgpu::FilterMode::Nearest,
            ..Default::default()
        });

        Self { pipeline, sampler }
    }