Skip to content

Commit

Permalink
Merge branch 'trunk' into shader_debug_flag
Browse files Browse the repository at this point in the history
  • Loading branch information
wicast committed Oct 20, 2023
2 parents 88e83c5 + d876e0d commit ae90d7e
Show file tree
Hide file tree
Showing 235 changed files with 12,312 additions and 5,095 deletions.
5 changes: 4 additions & 1 deletion .deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ skip-tree = [
{ name = "wgpu-info" },
]
skip = [
{ name = "wgpu" }
{ name = "wgpu" },
{ name = "fastrand" }
]
wildcards = "deny"

Expand All @@ -19,6 +20,7 @@ allow = [
"CC0-1.0",
"ISC",
"MIT",
"MIT-0",
"MPL-2.0",
"Unicode-DFS-2016",
"Zlib",
Expand All @@ -27,6 +29,7 @@ allow = [
[sources]
allow-git = [
"https://github.com/grovesNL/glow",
"https://github.com/gfx-rs/metal-rs",
]
unknown-registry = "deny"
unknown-git = "deny"
Expand Down
6 changes: 4 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/cts_runner/ @crowlKats
/deno_webgpu/ @crowlKats
* @gfx-rs/wgpu

/cts_runner/ @gfx-rs/deno @gfx-rs/wgpu
/deno_webgpu/ @gfx-rs/deno @gfx-rs/wgpu
163 changes: 116 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ env:
CARGO_TERM_COLOR: always
RUST_LOG: info
RUST_BACKTRACE: full
MSRV: 1.65
# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
REPO_MSRV: "1.70"
# This is the MSRV used by the `wgpu-core`, `wgpu-hal`, and `wgpu-types` crates,
# to ensure that they can be used with firefox.
CORE_MSRV: "1.65"
PKG_CONFIG_ALLOW_CROSS: 1 # allow android to work
RUSTFLAGS: --cfg=web_sys_unstable_apis -D warnings
RUSTDOCFLAGS: -Dwarnings
Expand All @@ -32,7 +36,7 @@ env:
# It adds overhead to the build and another point of failure.

jobs:
check-msrv:
check:
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -93,12 +97,13 @@ jobs:

steps:
- name: checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install MSRV toolchain
- name: Install Repo MSRV toolchain
run: |
rustup toolchain install ${{ env.MSRV }} --no-self-update --profile=minimal --component clippy --target ${{ matrix.target }}
rustup default ${{ env.MSRV }}
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal --component clippy --target ${{ matrix.target }}
rustup override set ${{ env.REPO_MSRV }}
cargo -V
- name: disable debug
shell: bash
Expand Down Expand Up @@ -176,12 +181,76 @@ jobs:
# build docs
cargo doc --target ${{ matrix.target }} --all-features --no-deps
# We run minimal checks on the MSRV of the core crates, ensuring that
# its dependency tree does not cause issues for firefox.
#
# We don't test all platforms, just ones with different dependency stacks.
check-core-msrv:
strategy:
fail-fast: false
matrix:
include:
# Windows
- name: Windows x86_64
os: windows-2022
target: x86_64-pc-windows-msvc

# MacOS
- name: MacOS x86_64
os: macos-12
target: x86_64-apple-darwin

# Linux
- name: Linux x86_64
os: ubuntu-22.04
target: x86_64-unknown-linux-gnu

name: MSRV Check ${{ matrix.name }}
runs-on: ${{ matrix.os }}

steps:
- name: checkout repo
uses: actions/checkout@v4

- name: Install Core MSRV toolchain
run: |
rustup toolchain install ${{ env.CORE_MSRV }} --no-self-update --profile=minimal --component clippy --target ${{ matrix.target }}
rustup override set ${{ env.CORE_MSRV }}
cargo -V
- name: disable debug
shell: bash
run: |
mkdir -p .cargo
echo """
[profile.dev]
debug = false" >> .cargo/config.toml
- name: caching
uses: Swatinem/rust-cache@v2
with:
key: msrv-check-${{ matrix.target }}-${{ env.CACHE_SUFFIX }}

- name: check native
shell: bash
run: |
set -e
# check wgpu-core with all features. This will also get wgpu-hal and wgpu-types.
cargo check --target ${{ matrix.target }} --all-features -p wgpu-core
wasm-test:
name: Test WebAssembly
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Repo MSRV toolchain
run: |
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal --component clippy --target wasm32-unknown-unknown
rustup override set ${{ env.REPO_MSRV }}
cargo -V
- name: Install wasm-pack
uses: taiki-e/install-action@v2
Expand All @@ -201,41 +270,31 @@ jobs:
# Windows
- name: Windows x86_64
os: windows-2022
backends: dx12

# Mac
- name: Mac aarch64
os: [self-hosted, macOS]
backends: vulkan metal

# Linux
- name: Linux x86_64
os: ubuntu-22.04
backends: vulkan gl


name: Test ${{ matrix.name }}
runs-on: ${{ matrix.os }}

steps:
- name: checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install cargo-nextest and cargo-llvm-cov
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest,cargo-llvm-cov

- name: install swiftshader
if: matrix.os == 'ubuntu-22.04'
shell: bash
- name: Install Repo MSRV toolchain
run: |
set -e
mkdir -p swiftshader
curl -LsSf https://github.com/gfx-rs/ci-build/releases/latest/download/swiftshader-linux-x86_64.tar.xz | tar -xf - -C swiftshader
echo "VK_ICD_FILENAMES=$PWD/swiftshader/vk_swiftshader_icd.json" >> $GITHUB_ENV
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal
cargo -V
- name: install llvmpipe, vulkan sdk
if: matrix.os == 'ubuntu-22.04'
Expand All @@ -249,8 +308,10 @@ jobs:
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
sudo add-apt-repository ppa:kisak/kisak-mesa
sudo apt-get update
sudo apt install -y libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev vulkan-sdk
sudo apt install -y libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev vulkan-sdk mesa-vulkan-drivers
- name: disable debug
shell: bash
Expand All @@ -266,24 +327,15 @@ jobs:
with:
key: test-${{ matrix.os }}-${{ env.CACHE_SUFFIX }}

- name: run wgpu-info
shell: bash
run: |
set -e
cargo llvm-cov --no-cfg-coverage run --bin wgpu-info --no-report --features vulkan-portability
- name: run tests
shell: bash
run: |
set -e
for backend in ${{ matrix.backends }}; do
echo "======= NATIVE TESTS $backend ======";
WGPU_BACKEND=$backend cargo llvm-cov --no-cfg-coverage nextest --no-fail-fast --no-report --features vulkan-portability
done
cargo xtask test --llvm-cov
- uses: actions/upload-artifact@v3
if: always() # We want artifacts even if the tests fail.
with:
name: comparison-images
path: |
Expand All @@ -308,7 +360,13 @@ jobs:

steps:
- name: checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Repo MSRV toolchain
run: |
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal --component rustfmt
rustup override set ${{ env.REPO_MSRV }}
cargo -V
- name: disable debug
shell: bash
Expand All @@ -321,7 +379,7 @@ jobs:
- name: caching
uses: Swatinem/rust-cache@v2
with:
key: clippy-${{ matrix.target }}-${{ matrix.kind }}-${{ env.CACHE_SUFFIX }}
key: doctests-${{ env.CACHE_SUFFIX }}

- name: run doctests
shell: bash
Expand All @@ -335,23 +393,31 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Repo MSRV toolchain
run: |
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal --component rustfmt
rustup override set ${{ env.REPO_MSRV }}
cargo -V
- name: run rustfmt
run: |
cargo fmt -- --check
cargo fmt --manifest-path xtask/Cargo.toml -- --check
check-msrv-cts_runner:
check-cts-runner:
name: Clippy cts_runner
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install MSRV toolchain
run: |
rustup toolchain install ${{ env.MSRV }} --no-self-update --profile=minimal --component clippy
rustup default ${{ env.MSRV }}
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal --component clippy
rustup override set ${{ env.REPO_MSRV }}
cargo -V
- name: disable debug
shell: bash
Expand All @@ -364,36 +430,39 @@ jobs:
- name: caching
uses: Swatinem/rust-cache@v2
with:
key: cts_runner-${{ env.CACHE_SUFFIX }}
key: cts-runner-${{ env.CACHE_SUFFIX }}

- name: build Deno
run: |
cargo clippy --manifest-path cts_runner/Cargo.toml
# Separate job so that new advisories don't block CI.
#
# This job is not required to pass for PRs to be merged.
cargo-deny-check-advisories:
name: "Run `cargo deny check advisories`"
name: "cargo-deny advisories"
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run `cargo deny check`
uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check advisories
arguments: --all-features --workspace
rust-version: ${{ env.MSRV }}
rust-version: ${{ env.REPO_MSRV }}

cargo-deny-check-rest:
name: "Run `cargo deny check`"
name: "cargo-deny"
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run `cargo deny check`
uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check bans licenses sources
arguments: --all-features --workspace
rust-version: ${{ env.MSRV }}
rust-version: ${{ env.REPO_MSRV }}
11 changes: 6 additions & 5 deletions .github/workflows/cts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
CARGO_INCREMENTAL: false
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
MSRV: 1.65
MSRV: "1.70"

jobs:
cts:
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:

steps:
- name: checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: wgpu

Expand All @@ -49,10 +49,11 @@ jobs:
cd cts
git checkout $(cat ../wgpu/cts_runner/revision.txt)
- name: Install MSRV toolchain
- name: Install Repo MSRV toolchain
run: |
rustup toolchain install ${{ env.MSRV }} --no-self-update --profile=minimal --target ${{ matrix.target }}
rustup default ${{ env.MSRV }}
rustup override set ${{ env.MSRV }}
cargo -V
- name: caching
uses: Swatinem/rust-cache@v2
Expand All @@ -74,7 +75,7 @@ jobs:
- name: disable debug
shell: bash
run: |
mkdir wgpu/.cargo
mkdir -p wgpu/.cargo
echo """[profile.dev]
debug = 1" > wgpu/.cargo/config.toml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: Checkout the code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

Expand Down
Loading

0 comments on commit ae90d7e

Please sign in to comment.