Skip to content

Commit

Permalink
Try to fix emscripten build
Browse files Browse the repository at this point in the history
  • Loading branch information
haraldreingruber-dedalus committed Jun 6, 2022
1 parent c2cba40 commit 0a1e816
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions wgpu-core/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
id.0
}

#[cfg(all(target_arch = "wasm32", feature = "webgl"))]
#[cfg(all(target_arch = "wasm32", feature = "webgl", not(feature = "emscripten")))]
pub fn create_surface_webgl_canvas(
&self,
canvas: &web_sys::HtmlCanvasElement,
Expand All @@ -516,7 +516,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
id.0
}

#[cfg(all(target_arch = "wasm32", feature = "webgl"))]
#[cfg(all(target_arch = "wasm32", feature = "webgl", not(feature = "emscripten")))]
pub fn create_surface_webgl_offscreen_canvas(
&self,
canvas: &web_sys::OffscreenCanvas,
Expand Down
4 changes: 2 additions & 2 deletions wgpu/src/backend/direct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ impl Context {
}
}

#[cfg(all(target_arch = "wasm32", feature = "webgl"))]
#[cfg(all(target_arch = "wasm32", feature = "webgl", not(feature = "emscripten")))]
pub fn instance_create_surface_from_canvas(
self: &Arc<Self>,
canvas: &web_sys::HtmlCanvasElement,
Expand All @@ -193,7 +193,7 @@ impl Context {
}
}

#[cfg(all(target_arch = "wasm32", feature = "webgl"))]
#[cfg(all(target_arch = "wasm32", feature = "webgl", not(feature = "emscripten")))]
pub fn instance_create_surface_from_offscreen_canvas(
self: &Arc<Self>,
canvas: &web_sys::OffscreenCanvas,
Expand Down
4 changes: 2 additions & 2 deletions wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,7 @@ impl Instance {
/// # Safety
///
/// - canvas must be a valid <canvas> element to create a surface upon.
#[cfg(target_arch = "wasm32")]
#[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))]
pub fn create_surface_from_canvas(&self, canvas: &web_sys::HtmlCanvasElement) -> Surface {
Surface {
context: Arc::clone(&self.context),
Expand All @@ -1752,7 +1752,7 @@ impl Instance {
/// # Safety
///
/// - canvas must be a valid OffscreenCanvas to create a surface upon.
#[cfg(target_arch = "wasm32")]
#[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))]
pub fn create_surface_from_offscreen_canvas(
&self,
canvas: &web_sys::OffscreenCanvas,
Expand Down

0 comments on commit 0a1e816

Please sign in to comment.