Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix surface creation cfgs in example framework. #3246

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ jobs:
set -e

# build for Emscripten/WebGL
cargo clippy --target ${{ matrix.target }} -p wgpu -p wgpu-hal --no-default-features --features webgl,emscripten
cargo clippy --target ${{ matrix.target }} -p wgpu -p wgpu-hal \
--no-default-features --features webgl,emscripten

# build cube example
cargo clippy --target ${{ matrix.target }} --example cube --features webgl,emscripten

# build raw-gles example
cargo clippy --target ${{ matrix.target }} --example raw-gles --features webgl,emscripten
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ Additionally `Surface::get_default_config` now returns an Option and returns Non
zero, rather than treating that as "until the end of the buffer".
By @jimblandy in [#3171](https://github.com/gfx-rs/wgpu/pull/3171)

#### Emscripten

- Let the wgpu examples `framework.rs` compile again under Emscripten. By @jimblandy in [#3246](https://github.com/gfx-rs/wgpu/pull/3246)

### Examples

- Log adapter info in hello example on wasm target by @JolifantoBambla in [#2858](https://github.com/gfx-rs/wgpu/pull/2858)
Expand Down
4 changes: 2 additions & 2 deletions wgpu/examples/framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ async fn setup<E: Example>(title: &str) -> Setup {
let (size, surface) = unsafe {
let size = window.inner_size();

#[cfg(not(target_arch = "wasm32"))]
#[cfg(any(not(target_arch = "wasm32"), target_os = "emscripten"))]
let surface = instance.create_surface(&window);
#[cfg(target_arch = "wasm32")]
#[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))]
let surface = {
if let Some(offscreen_canvas_setup) = &offscreen_canvas_setup {
log::info!("Creating surface from OffscreenCanvas");
Expand Down