diff --git a/Cargo.lock b/Cargo.lock index df371fc679..3e7cc227ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3827,7 +3827,7 @@ checksum = "493fcbab756bb764fa37e6bee8cec2dd709eb4273d06d0c282a5e74275ded735" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] diff --git a/examples/bunnymark/screenshot.png b/examples/bunnymark/screenshot.png index d26f5f81c3..132a1f79bb 100644 Binary files a/examples/bunnymark/screenshot.png and b/examples/bunnymark/screenshot.png differ diff --git a/examples/bunnymark/src/main.rs b/examples/bunnymark/src/main.rs index 28417246ce..fc6d4414c9 100644 --- a/examples/bunnymark/src/main.rs +++ b/examples/bunnymark/src/main.rs @@ -58,7 +58,7 @@ struct Example { impl Example { fn spawn_bunnies(&mut self) { - let spawn_count = 64 + self.bunnies.len() / 2; + let spawn_count = 64; let color = self.rng.generate::(); println!( "Spawning {} bunnies, total at {}", @@ -331,7 +331,7 @@ impl wgpu_example::framework::Example for Example { let rng = WyRand::new_seed(42); - Example { + let mut ex = Example { pipeline, global_group, local_group, @@ -339,7 +339,11 @@ impl wgpu_example::framework::Example for Example { local_buffer, extent: [config.width, config.height], rng, - } + }; + + ex.spawn_bunnies(); + + ex } fn update(&mut self, event: winit::event::WindowEvent) { @@ -367,11 +371,7 @@ impl wgpu_example::framework::Example for Example { } fn render(&mut self, view: &wgpu::TextureView, device: &wgpu::Device, queue: &wgpu::Queue) { - self.spawn_bunnies(); - - for _frame_number in 0..3 { - self.render_inner(view, device, queue); - } + self.render_inner(view, device, queue); } } diff --git a/examples/uniform-values/src/main.rs b/examples/uniform-values/src/main.rs index 50b7e7d6ab..48faf857c5 100644 --- a/examples/uniform-values/src/main.rs +++ b/examples/uniform-values/src/main.rs @@ -362,14 +362,14 @@ fn main() { console_log::init().expect("could not initialize logger"); use winit::platform::web::WindowExtWebSys; + let canvas = window.canvas().expect("Couldn't get canvas"); + canvas.style().set_css_text("height: 100%; width: 100%;"); + let document = web_sys::window() .and_then(|win| win.document()) .expect("Failed to get document."); let body = document.body().unwrap(); - body.append_child(&web_sys::Element::from( - window.canvas().expect("Couldn't get canvas"), - )) - .unwrap(); + body.append_child(&canvas).unwrap(); let controls_text = document .create_element("p") .expect("Failed to create controls text as element.");