mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Fix surface creation cfgs in example framework. (#3246)
This commit is contained in:
parent
a9d33193b3
commit
9c6a60d97c
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user