Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

First step for WebGL support. #684

Merged
merged 1 commit into from
Dec 22, 2020
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
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,21 @@ trace = ["serde", "wgc/trace"]
replay = ["serde", "wgc/replay"]
# Make Vulkan backend available on platforms where it is by default not, e.g. macOS
vulkan-portability = ["wgc/gfx-backend-vulkan"]
webgl = ["wgc"]

[target.'cfg(not(target_arch = "wasm32"))'.dependencies.wgc]
package = "wgpu-core"
git = "https://github.com/gfx-rs/wgpu"
rev = "4ebe1f50b057046e4d4f015eb006330d62f5fe91"
features = ["raw-window-handle"]

[target.'cfg(target_arch = "wasm32")'.dependencies.wgc]
package = "wgpu-core"
git = "https://github.com/gfx-rs/wgpu"
rev = "4ebe1f50b057046e4d4f015eb006330d62f5fe91"
features = ["raw-window-handle"]
optional = true

[dependencies.wgt]
package = "wgpu-types"
git = "https://github.com/gfx-rs/wgpu"
Expand Down
12 changes: 6 additions & 6 deletions src/backend/mod.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#[cfg(target_arch = "wasm32")]
#[cfg(all(target_arch = "wasm32", not(feature = "webgl")))]
mod web;
#[cfg(target_arch = "wasm32")]
#[cfg(all(target_arch = "wasm32", not(feature = "webgl")))]
pub(crate) use web::{BufferMappedRange, Context};

#[cfg(not(target_arch = "wasm32"))]
#[cfg(any(not(target_arch = "wasm32"), feature = "webgl"))]
mod direct;
#[cfg(not(target_arch = "wasm32"))]
#[cfg(any(not(target_arch = "wasm32"), feature = "webgl"))]
mod error;

#[cfg(not(target_arch = "wasm32"))]
#[cfg(any(not(target_arch = "wasm32"), feature = "webgl"))]
pub(crate) use direct::{BufferMappedRange, Context};

#[cfg(not(target_arch = "wasm32"))]
#[cfg(any(not(target_arch = "wasm32"), feature = "webgl"))]
mod native_gpu_future;