diff options
| author | Micha White <botahamec@outlook.com> | 2022-11-27 22:34:13 -0500 |
|---|---|---|
| committer | Micha White <botahamec@outlook.com> | 2022-11-27 22:34:13 -0500 |
| commit | 75752a400925738d90c2267b4c15ef2b554725fe (patch) | |
| tree | 6dcd60b5471d6cb343b39c22ceadff5ca7298f1a /alligator_render/src/renderer.rs | |
| parent | 2d0e03426f95cc402609d13042827de649fa253c (diff) | |
Small performance improvement
Diffstat (limited to 'alligator_render/src/renderer.rs')
| -rw-r--r-- | alligator_render/src/renderer.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/alligator_render/src/renderer.rs b/alligator_render/src/renderer.rs index 064ff31..27e7884 100644 --- a/alligator_render/src/renderer.rs +++ b/alligator_render/src/renderer.rs @@ -303,12 +303,6 @@ impl Renderer { /// that can be used for the new frame. #[profiling::function] fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - // the new texture we can render to - let output = self.surface.get_current_texture()?; - let view = output - .texture - .create_view(&wgpu::TextureViewDescriptor::default()); - // this will allow us to send commands to the gpu let mut encoder = self .device @@ -321,6 +315,12 @@ impl Renderer { self.camera.refresh(&self.queue); self.textures.fill_textures(&self.queue); + // the new texture we can render to + let output = self.surface.get_current_texture()?; + let view = output + .texture + .create_view(&wgpu::TextureViewDescriptor::default()); + { profiling::scope!("encode render pass"); let mut render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { |
