fn render(&mut self) -> Result<(), wgpu::SurfaceError> {
        let frame = self.surface.get_current_texture()?;
        let frame_tex_view = frame.texture.create_view(&self.surface_view_desc);
        let mut encoder = self
            .device
            .create_command_encoder(&wgpu::CommandEncoderDescriptor {
                label: Some("Render Encoder"),
            });

        self.front_face_pass
            .render(&self.front_face_render_buffer.view, None, &mut encoder);
        self.back_face_pass
            .render(&self.back_face_render_buffer.view, None, &mut encoder);
        self.canvas_pass.render(&frame_tex_view, None, &mut encoder);
        self.queue.submit(std::iter::once(encoder.finish()));
        frame.present();
        Ok(())
    }
// We also need to create a CommandEncoder to create the actual commands to send to the gpu.
// Most modern graphics frameworks expect commands to be stored in a command buffer before being sent to the gpu.
// The encoder builds a command buffer that we can then send to the gpu.
We also need to create a CommandEncoder to create the actual commands to send to the gpu.
Most modern graphics frameworks expect commands to be stored in a command buffer before being sent to the gpu.
The encoder builds a command buffer that we can then send to the gpu.
We also need to create a CommandEncoder to create the actual commands to send to the gpu . Most modern graphics frameworks expect commands to be stored in a command buffer before being sent to the gpu . The encoder builds a command buffer that we can then send to the gpu .
fn render(&mut self) -> Result<(), wgpu::SurfaceError> {
        let frame = self.surface.get_current_texture()?;
        let frame_tex_view = frame.texture.create_view(&self.surface_view_desc);
        let mut encoder = self
            .device
            .create_command_encoder(&wgpu::CommandEncoderDescriptor {
                label: Some("Render Encoder"),
            });
        self.front_face_pass
            .render(&self.front_face_render_buffer.view, None, &mut encoder);
        self.back_face_pass
            .render(&self.back_face_render_buffer.view, None, &mut encoder);
        self.canvas_pass.render(&frame_tex_view, None, &mut encoder);
        self.queue.submit(std::iter::once(encoder.finish()));
        frame.present();
        Ok(())
    }
fn render ( & mut self ) -> Result < ( ) , wgpu :: SurfaceError > { let frame = self . surface . get_current_texture ( ) ? ; let frame_tex_view = frame . texture . create_view ( & self . surface_view_desc ) ; let mut encoder = self . device . create_command_encoder ( & wgpu :: CommandEncoderDescriptor { label : Some ( " " ) , } ) ; self . front_face_pass . render ( & self . front_face_render_buffer . view , None , & mut encoder ) ; self . back_face_pass . render ( & self . back_face_render_buffer . view , None , & mut encoder ) ; self . canvas_pass . render ( & frame_tex_view , None , & mut encoder ) ; self . queue . submit ( std :: iter :: once ( encoder . finish ( ) ) ) ; frame . present ( ) ; Ok ( ( ) ) }
We also need to create a CommandEncoder to create the actual commands to send to the gpu.
We also need to create a CommandEncoder to create the actual commands to send to the gpu .
&mut self
&mut self