Skip to content

Commit

Permalink
fixed rt hal example after trunk merge
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-keitel committed Sep 16, 2023
1 parent a919529 commit a09d116
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions wgpu-hal/examples/ray-traced-triangle/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use std::{
ptr::{self, copy_nonoverlapping},
time::Instant,
};
use winit::window::WindowButtons;

const COMMAND_BUFFER_PER_CONTEXT: usize = 100;
const DESIRED_FRAMES: u32 = 3;
Expand Down Expand Up @@ -237,14 +238,14 @@ impl<A: hal::Api> Example<A> {
let (adapter, features) = unsafe {
let mut adapters = instance.enumerate_adapters();
if adapters.is_empty() {
return Err(hal::InstanceError);
panic!("No adapters found");
}
let exposed = adapters.swap_remove(0);
dbg!(exposed.features);
(exposed.adapter, exposed.features)
};
let surface_caps =
unsafe { adapter.surface_capabilities(&surface) }.ok_or(hal::InstanceError)?;
let surface_caps = unsafe { adapter.surface_capabilities(&surface) }
.expect("Surface doesn't support presentation");
log::info!("Surface caps: {:#?}", surface_caps);

let hal::OpenDevice { device, mut queue } =
Expand Down Expand Up @@ -1078,6 +1079,7 @@ fn main() {
height: 512,
})
.with_resizable(false)
.with_enabled_buttons(WindowButtons::CLOSE)
.build(&event_loop)
.unwrap();

Expand Down

0 comments on commit a09d116

Please sign in to comment.