Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
fornwall committed Jun 12, 2023
1 parent c6a6dad commit 943789a
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ pub async fn run() {
init_logging();

let event_loop = EventLoop::new();
let mut window = WindowBuilder::new()
//.with_title("WGPU Start")
//.with_fullscreen(Some(winit::window::Fullscreen::Borderless(None)))
.build(&event_loop)
.unwrap();

#[cfg(target_arch = "wasm32")]
let mut window = WindowBuilder::new().build(&event_loop).unwrap();
#[cfg(not(target_arch = "wasm32"))]
let window = WindowBuilder::new().build(&event_loop).unwrap();

#[cfg(target_arch = "wasm32")]
setup_html_canvas(&mut window);
Expand Down Expand Up @@ -185,20 +185,8 @@ impl<'a> State<'a> {
mapped_at_creation: false,
});

let compute_shader = device.create_shader_module(
// Using the macro:
// wgpu::include_wgsl!("game-of-life.compute.wgsl"));
// does not allow string replacement, which we need to do until wgpu
// supports override.
wgpu::ShaderModuleDescriptor {
label: Some("compute_shader"),
source: wgpu::ShaderSource::Wgsl(
include_str!("game-of-life.compute.wgsl")
.replace("__CELL_WIDTH__", &format!("{}", cells_width))
.into(),
),
},
);
let compute_shader =
device.create_shader_module(wgpu::include_wgsl!("game-of-life.compute.wgsl"));

let compute_bind_group_layout =
device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
Expand Down

0 comments on commit 943789a

Please sign in to comment.