[rs] First step for WebGL support.

This commit is contained in:
Vincent Jousse
2020-12-19 14:57:11 +01:00
parent 860265e5e9
commit 9f3a050fc4
2 changed files with 14 additions and 6 deletions

View File

@@ -21,6 +21,7 @@ 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"
@@ -28,6 +29,13 @@ 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"

View File

@@ -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;