Test WebGPU backend with extra features

This commit is contained in:
Dzmitry Malyshau 2022-01-06 12:02:44 -05:00
parent 4bfa2722f7
commit 043e36c59a
5 changed files with 23 additions and 5 deletions

View File

@ -156,10 +156,14 @@ jobs:
- name: check web
if: matrix.kind == 'web'
run: |
cargo ${{matrix.tool}} --target ${{ matrix.target }} -p wgpu
# build examples
cargo ${{matrix.tool}} --target ${{ matrix.target }} -p wgpu --examples
# Build for WebGL
cargo ${{matrix.tool}} --target ${{ matrix.target }} -p wgpu --features webgl -- -D warnings
# build with features
cargo ${{matrix.tool}} --target ${{ matrix.target }} -p wgpu --features glsl,spirv
# build for WebGL
cargo ${{matrix.tool}} --target ${{ matrix.target }} -p wgpu --features webgl
# build docs
cargo doc --target ${{ matrix.target }} -p wgpu --no-deps

View File

@ -85,6 +85,8 @@ git = "https://github.com/gfx-rs/naga"
rev = "09d35f3"
#version = "0.8"
# DEV dependencies
[dev-dependencies.naga]
git = "https://github.com/gfx-rs/naga"
rev = "09d35f3"
@ -94,4 +96,6 @@ features = ["wgsl-in"]
[dev-dependencies]
env_logger = "0.8"
winit = "0.26" # for "halmark" example
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
glutin = "0.28" # for "gles" example

View File

@ -2,9 +2,14 @@
//! the ability to hook up wgpu-hal to an existing context and draw into it.
extern crate wgpu_hal as hal;
use hal::{Adapter as _, CommandEncoder as _, Device as _, Queue as _};
#[cfg(target_arch = "wasm32")]
fn main() {}
#[cfg(not(target_arch = "wasm32"))]
fn main() {
use hal::{Adapter as _, CommandEncoder as _, Device as _, Queue as _};
env_logger::init();
println!("Initializing external GL context");

View File

@ -104,9 +104,12 @@ fn print_info_from_adapter(adapter: &wgpu::Adapter, idx: usize) {
}
}
#[cfg(target_arch = "wasm32")]
fn main() {}
#[cfg(not(target_arch = "wasm32"))]
fn main() {
env_logger::init();
let args: Vec<_> = std::env::args().skip(1).collect();
let instance = wgpu::Instance::new(wgpu::Backends::all());

View File

@ -1,3 +1,5 @@
#![cfg_attr(target_arch = "wasm32", allow(dead_code))]
use std::collections::HashMap;
use winit::{
event::{Event, WindowEvent},