Skip to content

Commit

Permalink
Merge branch 'trunk' into stack-overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cwfitzgerald authored Jan 13, 2025
2 parents da2ade9 + f6dd3a4 commit c8bda92
Show file tree
Hide file tree
Showing 167 changed files with 3,999 additions and 996 deletions.
119 changes: 97 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ name: CI

on:
push:
branches: ["*"]
branches-ignore: [
# We don't need to run on dependabot PRs.
"dependabot/**",
# This is the branch the merge queue creates.
"gh-readonly-queue/**"
]
tags: [v0.*]
pull_request:
merge_group:
Expand Down Expand Up @@ -34,7 +39,7 @@ env:
# We sometimes need nightly to use special things in CI.
#
# In order to prevent CI regressions, we pin the nightly version.
NIGHTLY_VERSION: "nightly-2024-10-10"
NIGHTLY_VERSION: "nightly-2024-10-17"
# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
REPO_MSRV: "1.83"
# This is the MSRV used by the `wgpu-core`, `wgpu-hal`, and `wgpu-types` crates,
Expand All @@ -48,7 +53,7 @@ env:
CARGO_INCREMENTAL: false
CARGO_TERM_COLOR: always
WGPU_DX12_COMPILER: dxc
RUST_LOG: info
RUST_LOG: debug
RUST_BACKTRACE: full
PKG_CONFIG_ALLOW_CROSS: 1 # allow android to work
RUSTFLAGS: -D warnings
Expand Down Expand Up @@ -86,58 +91,93 @@ jobs:
- name: Windows x86_64
os: windows-2022
target: x86_64-pc-windows-msvc
tier: 1
kind: native

# Windows
- name: Windows aarch64
os: windows-2022
target: aarch64-pc-windows-msvc
tier: 2
kind: native

# MacOS
- name: MacOS x86_64
os: macos-14
target: x86_64-apple-darwin
tier: 1
kind: native

- name: MacOS aarch64
os: macos-14
target: aarch64-apple-darwin
tier: 1
kind: native

# IOS
- name: IOS aarch64
os: macos-14
target: aarch64-apple-ios
tier: 2
kind: native

# VisionOS
- name: VisionOS aarch64
os: macos-14
target: aarch64-apple-visionos
kind: wgpu-only
tier: 3
extra-flags: -Zbuild-std

# Linux
- name: Linux x86_64
os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
tier: 1
kind: native

- name: Linux aarch64
os: ubuntu-22.04
target: aarch64-unknown-linux-gnu
tier: 1
kind: native

# Android
- name: Android aarch64
os: ubuntu-22.04
target: aarch64-linux-android
tier: 2
kind: native

# WebGPU/WebGL
- name: WebAssembly
os: ubuntu-22.04
target: wasm32-unknown-unknown
tier: 2
kind: web

- name: Emscripten
os: ubuntu-22.04
target: wasm32-unknown-emscripten
kind: em
tier: 2
kind: wgpu-only

# TODO: Uncomment once web-sys updates past 0.3.76
# See https://github.com/rustwasm/wasm-bindgen/pull/4378 for details
# - name: WebAssembly Core 1.0
# os: ubuntu-22.04
# target: wasm32v1-none
# tier: 2
# kind: no_std

# Bare-metal x86-64
# TODO: Remove once web-sys updates past 0.3.76
# Included while wasm32v1-none is failing to ensure `no_std` does not regress
- name: no_std x86_64
os: ubuntu-22.04
target: x86_64-unknown-none
tier: 2
kind: no_std

name: Clippy ${{ matrix.name }}
runs-on: ${{ matrix.os }}
Expand All @@ -146,12 +186,31 @@ jobs:
- name: checkout repo
uses: actions/checkout@v4

- name: Install Repo MSRV toolchain
- name: Install Toolchain (Repo MSRV - Tier 1 or 2)
if: matrix.tier == 1 || matrix.tier == 2
run: |
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal --component clippy --target ${{ matrix.target }}
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal --component clippy
rustup target add ${{ matrix.target }} --toolchain ${{ env.REPO_MSRV }}
rustup override set ${{ env.REPO_MSRV }}
cargo -V
# In order to build on platforms that require a nightly toolchain, we install stable as expected,
# add the rust-src component, then tell stable to consider itself nightly by setting RUSTC_BOOTSTRAP=1.
#
# This is not formally "correct" thing to do, but it saves significant maintainer burden. If we were to
# use a proper nightly toolchain we would have to manually find a date that works. Even with a date that is
# carefully coordinated with the version of stable we are using, there are often mismatches of clippy lints
# between nightly and stable. This is a real mess. By using RUSTC_BOOTSTRAP=1, we get access to all the nice
# nightly features without needing to go through the hassle of maintaining a nightly toolchain.
#
# RUSTC_BOOTSTRAP=1 is how the rust project builds itself when bootstrapping the compiler, so while not "stable"
# it has been around for many years and don't anticipate it going away any time soon.
- name: Install Toolchain (Repo MSRV - Tier 3)
if: matrix.tier == 3
run: |
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal --component clippy,rust-src
echo "RUSTC_BOOTSTRAP=1" >> "$GITHUB_ENV"
- name: disable debug
shell: bash
run: |
Expand Down Expand Up @@ -183,50 +242,66 @@ jobs:
# the android sdk doesn't use the conventional name for ar, so explicitly set it.
echo "AR_aarch64_linux_android=llvm-ar" >> "$GITHUB_ENV"
# Building for wasm32 requires a series of specific tests for the WebGPU backend.
- name: check web
if: matrix.kind == 'web'
shell: bash
run: |
set -e
# build for WebGPU
cargo clippy --target ${{ matrix.target }} --tests --features glsl,spirv,fragile-send-sync-non-atomic-wasm
cargo clippy --target ${{ matrix.target }} --tests --features glsl,spirv
cargo doc --target ${{ matrix.target }} --no-deps --features glsl,spirv
cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} --tests --features glsl,spirv,fragile-send-sync-non-atomic-wasm
cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} --tests --features glsl,spirv
cargo doc --target ${{ matrix.target }} ${{ matrix.extra-flags }} --no-deps --features glsl,spirv
# all features
cargo clippy --target ${{ matrix.target }} --tests --all-features
cargo doc --target ${{ matrix.target }} --no-deps --all-features
cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} --tests --all-features
cargo doc --target ${{ matrix.target }} ${{ matrix.extra-flags }} --no-deps --all-features
- name: check em
if: matrix.kind == 'em'
# Building for platforms where the tests do not compile.
- name: check wgpu only
if: matrix.kind == 'wgpu-only'
shell: bash
run: |
set -e
# build for Emscripten
cargo clippy --target ${{ matrix.target }} -p wgpu -p wgpu-hal --no-default-features
# check with no features
cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p wgpu -p wgpu-hal --no-default-features
# Don't check samples since we use winit in our samples which has dropped support for Emscripten.
# all features
cargo clippy --target ${{ matrix.target }} -p wgpu-hal --all-features
cargo clippy --target ${{ matrix.target }} -p wgpu --all-features
# Check with all features.
cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p wgpu-hal --all-features
cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p wgpu --all-features
# Building for no_std platforms where every feature is enabled except "std".
- name: check no_std
if: matrix.kind == 'no_std'
shell: bash
run: |
set -e
# check with no features
cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p wgpu-types --no-default-features
# Check with all features except "std".
cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p wgpu-types --no-default-features --features strict_asserts,fragile-send-sync-non-atomic-wasm,serde,counters
# Building for native platforms with standard tests.
- name: check native
if: matrix.kind == 'native'
shell: bash
run: |
set -e
# check with no features
cargo clippy --target ${{ matrix.target }} --no-default-features
cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} --no-default-features
# Check with all features.
cargo clippy --target ${{ matrix.target }} --tests --benches --all-features
cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} --tests --benches --all-features
# build docs
cargo doc --target ${{ matrix.target }} --all-features --no-deps
cargo doc --target ${{ matrix.target }} ${{ matrix.extra-flags }} --all-features --no-deps
- name: check private item docs
if: matrix.kind == 'native'
Expand All @@ -235,7 +310,7 @@ jobs:
set -e
# wgpu_core package
cargo doc --target ${{ matrix.target }} \
cargo doc --target ${{ matrix.target }} ${{ matrix.extra-flags }} \
--package wgpu-core \
--package wgpu-hal \
--package naga \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
# We need to use nightly for various features
# when building docs.rs style docs.
NIGHTLY_VERSION: nightly-2023-12-17
NIGHTLY_VERSION: nightly-2025-01-09

CARGO_INCREMENTAL: false
CARGO_TERM_COLOR: always
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/shaders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ name: Shaders

on:
push:
branches: ["*"]
branches-ignore: [
# We don't need to run on dependabot PRs.
"dependabot/**",
# This is the branch the merge queue creates.
"gh-readonly-queue/**"
]
tags: [v0.*]
pull_request:
merge_group:
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,20 @@ By @wumpf in [#6849](https://github.com/gfx-rs/wgpu/pull/6849).
- Move raytracing alignments into HAL instead of in core. By @Vecvec in [#6563](https://github.com/gfx-rs/wgpu/pull/6563).
- Allow for statically linking DXC rather than including separate `.dll` files. By @DouglasDwyer in [#6574](https://github.com/gfx-rs/wgpu/pull/6574).
- `DeviceType` and `AdapterInfo` now impl `Hash` by @cwfitzgerald in [#6868](https://github.com/gfx-rs/wgpu/pull/6868)
- Add build support for Apple Vision Pro. By @guusw in [#6611](https://github.com/gfx-rs/wgpu/pull/6611).
- Add `wgsl_language_features` for obtaining available WGSL language feature by @sagudev in [#6814](https://github.com/gfx-rs/wgpu/pull/6814)
- Image atomic support in shaders. By @atlv24 in [#6706](https://github.com/gfx-rs/wgpu/pull/6706)
- Add `no_std` support to `wgpu-types`. By @bushrat011899 in [#6892](https://github.com/gfx-rs/wgpu/pull/6892).

##### Vulkan

- Allow using some 32-bit floating-point atomic operations (load, store, add, sub, exchange) in shaders. It requires the extension `VK_EXT_shader_atomic_float`. By @AsherJingkongChen in [#6234](https://github.com/gfx-rs/wgpu/pull/6234).

##### Metal

- Allow using some 32-bit floating-point atomic operations (load, store, add, sub, exchange) in shaders. It requires Metal 3.0+ with Apple 7, 8, 9 or Mac 2. By @AsherJingkongChen in [#6234](https://github.com/gfx-rs/wgpu/pull/6234).
- Add build support for Apple Vision Pro. By @guusw in [#6611](https://github.com/gfx-rs/wgpu/pull/6611).
- Add `raw_handle` method to access raw Metal textures in [#6894](https://github.com/gfx-rs/wgpu/pull/6894).

#### Changes

Expand All @@ -171,6 +185,7 @@ By @wumpf in [#6849](https://github.com/gfx-rs/wgpu/pull/6849).
- The GLSL parser now uses less expressions for function calls. By @magcius in [#6604](https://github.com/gfx-rs/wgpu/pull/6604).
- Add a note to help with a common syntax error case for global diagnostic filter directives. By @e-hat in [#6718](https://github.com/gfx-rs/wgpu/pull/6718)
- Change arithmetic operations between two i32 variables to wrap on overflow to match WGSL spec. By @matthew-wong1 in [#6835](https://github.com/gfx-rs/wgpu/pull/6835).
- Add directives to suggestions in error message for parsing global items. By @e-hat in [#6723](https://github.com/gfx-rs/wgpu/pull/6723).

##### General

Expand Down
Loading

0 comments on commit c8bda92

Please sign in to comment.