Skip to content

Commit

Permalink
feature = emscripten, compability fixes for wgpu-native
Browse files Browse the repository at this point in the history
  • Loading branch information
caiiiycuk committed Feb 3, 2022
1 parent 63dfd98 commit 99109fb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions wgpu-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ trace = ["ron", "serde", "wgt/trace", "arrayvec/serde", "naga/serialize"]
replay = ["serde", "wgt/replay", "arrayvec/serde", "naga/deserialize"]
# Enable serializable compute/render passes, and bundle encoders.
serial-pass = ["serde", "wgt/serde", "arrayvec/serde"]
emscripten = ["hal/emscripten"]

[dependencies]
arrayvec = "0.7"
Expand Down
4 changes: 4 additions & 0 deletions wgpu-hal/src/gles/egl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,10 @@ impl Inner {

// Testing if context can be binded without surface
// and creating dummy pbuffer surface if not.
#[cfg(feature = "emscripten")]
let pbuffer = None;

#[cfg(not(feature = "emscripten"))]
let pbuffer =
if version >= (1, 5) || display_extensions.contains("EGL_KHR_surfaceless_context") {
log::info!("\tEGL context: +surfaceless");
Expand Down
2 changes: 1 addition & 1 deletion wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ trace = ["serde", "wgc/trace"]
replay = ["serde", "wgc/replay"]
angle = ["wgc/angle"]
webgl = ["wgc"]
emscripten = ["webgl"]
emscripten = ["webgl", "wgc/emscripten"]

[target.'cfg(not(target_arch = "wasm32"))'.dependencies.wgc]
package = "wgpu-core"
Expand Down

0 comments on commit 99109fb

Please sign in to comment.