pub fn new(
        gpu: &'a Gpu,
        surface: &wgpu::Surface,
        depth: wgpu::TextureView,
    ) -> Result<Self, GpuError> {
        let frame = surface
            .get_current_texture()
            .map_err(GpuError::SurfaceError)?;
        let frame_view = frame.texture.create_view(&wgpu::TextureViewDescriptor {
            // TODO: Custom label
            label: Some("Viewport frame view"),
            ..Default::default()
        });
        let mut encoder = gpu.create_command_encoder("Viewport render encoder");

        gpu.begin_profiler_section("Frame start", &mut encoder);

        Ok(Frame {
            gpu,
            surface_texture: ManuallyDrop::new(frame),
            depth_texture: gpu.wrap_view(depth),
            view: gpu.wrap_view(frame_view),
            encoder: ManuallyDrop::new(encoder),
            delta_time: None,
            resized_to: None,
        })
    }
/// Creates a new Frame from the Surface
/// We
Creates a new Frame from the Surface
We
Creates a new Frame from the Surface We
pub fn new(
        gpu: &'a Gpu,
        surface: &wgpu::Surface,
        depth: wgpu::TextureView,
    ) -> Result<Self, GpuError> {
        let frame = surface
            .get_current_texture()
            .map_err(GpuError::SurfaceError)?;
        let frame_view = frame.texture.create_view(&wgpu::TextureViewDescriptor {
            // TODO: Custom label
            label: Some("Viewport frame view"),
            ..Default::default()
        });
        let mut encoder = gpu.create_command_encoder("Viewport render encoder");
        gpu.begin_profiler_section("Frame start", &mut encoder);
        Ok(Frame {
            gpu,
            surface_texture: ManuallyDrop::new(frame),
            depth_texture: gpu.wrap_view(depth),
            view: gpu.wrap_view(frame_view),
            encoder: ManuallyDrop::new(encoder),
            delta_time: None,
            resized_to: None,
        })
    }
pub fn new ( gpu : & ' a Gpu , surface : & wgpu :: Surface , depth : wgpu :: TextureView , ) -> Result < Self , GpuError > { let frame = surface . get_current_texture ( ) . map_err ( GpuError :: SurfaceError ) ? ; let frame_view = frame . texture . create_view ( & wgpu :: TextureViewDescriptor { // TODO: Custom label label : Some ( " " ) , .. Default :: default ( ) } ) ; let mut encoder = gpu . create_command_encoder ( " " ) ; gpu . begin_profiler_section ( " " , & mut encoder ) ; Ok ( Frame { gpu , surface_texture : ManuallyDrop :: new ( frame ) , depth_texture : gpu . wrap_view ( depth ) , view : gpu . wrap_view ( frame_view ) , encoder : ManuallyDrop :: new ( encoder ) , delta_time : None , resized_to : None , } ) }
Creates a new Frame from the Surface
We
Creates a new Frame from the Surface We
gpu
&'a Gpu
surface
&wgpu::Surface
depth
wgpu::TextureView
gpu
&'a Gpu
surface
&wgpu::Surface
depth
wgpu::TextureView