684: First step for WebGL support. r=grovesNL a=VincentFTS

This permits to test WebGL backend in Wgpu-rs.
Next step is to test examples to make them work with WebGL backend !

Co-authored-by: Vincent Jousse <contact@ftsoftware.fr>
This commit is contained in:
bors[bot] 2020-12-22 17:48:23 +00:00 committed by GitHub
commit f1604cdc57
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;