summaryrefslogtreecommitdiff
path: root/alligator_render
diff options
context:
space:
mode:
Diffstat (limited to 'alligator_render')
-rw-r--r--alligator_render/examples/bunnymark.rs1
-rw-r--r--alligator_render/src/renderer.rs12
2 files changed, 7 insertions, 6 deletions
diff --git a/alligator_render/examples/bunnymark.rs b/alligator_render/examples/bunnymark.rs
index 7ef97b7..62371c9 100644
--- a/alligator_render/examples/bunnymark.rs
+++ b/alligator_render/examples/bunnymark.rs
@@ -113,6 +113,7 @@ fn main() {
default_width: NonZeroU32::new(1280).unwrap(),
default_height: NonZeroU32::new(720).unwrap(),
vsync: false,
+ low_power: false,
..Default::default()
};
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 {