Skip to content

Commit

Permalink
Fix wasm target
Browse files Browse the repository at this point in the history
  • Loading branch information
jinleili committed Sep 19, 2022
1 parent 627fdf8 commit 5de3ffe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wgpu/examples/framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ fn start<E: Example>(
) {
let spawner = Spawner::new();
let mut config = wgpu::SurfaceConfiguration::from_size(size.width, size.height);
#[cfg(target_arch = "wasm32")]
{
config.format = surface.get_supported_formats(&adapter)[0];
}
surface.configure(&device, &config);

log::info!("Initializing the example...");
Expand Down

0 comments on commit 5de3ffe

Please sign in to comment.