diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 981fcd3498..4e85c569d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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: @@ -95,10 +99,11 @@ jobs: - name: checkout repo 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 @@ -176,6 +181,64 @@ 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 @@ -183,6 +246,12 @@ jobs: - name: checkout repo 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 with: @@ -213,7 +282,6 @@ jobs: os: ubuntu-22.04 backends: vulkan gl - name: Test ${{ matrix.name }} runs-on: ${{ matrix.os }} @@ -311,6 +379,12 @@ jobs: - name: checkout repo 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 run: | @@ -322,7 +396,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 @@ -338,11 +412,17 @@ jobs: - name: checkout repo 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 - check-msrv-cts_runner: + check-cts-runner: name: Clippy cts_runner runs-on: ubuntu-latest steps: @@ -351,8 +431,9 @@ jobs: - 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 @@ -365,14 +446,17 @@ 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 @@ -383,10 +467,10 @@ jobs: 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 @@ -397,4 +481,4 @@ jobs: with: command: check bans licenses sources arguments: --all-features --workspace - rust-version: ${{ env.MSRV }} + rust-version: ${{ env.REPO_MSRV }} diff --git a/.github/workflows/cts.yml b/.github/workflows/cts.yml index e4bb20e7b1..35ac5b60aa 100644 --- a/.github/workflows/cts.yml +++ b/.github/workflows/cts.yml @@ -11,7 +11,7 @@ env: CARGO_INCREMENTAL: false CARGO_TERM_COLOR: always RUST_BACKTRACE: full - MSRV: 1.65 + MSRV: "1.70" jobs: cts: @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index b098386472..bf05a41e37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -85,6 +85,12 @@ depth_ops: Some(wgpu::Operations { By @wumpf in [#4147](https://github.com/gfx-rs/wgpu/pull/4147) +#### The GLES backend is now optional on Windows & macOS + +The `angle` feature flag has to be set for the GLES backend to be enabled on Windows & macOS. + +By @teoxoy in [#4185](https://github.com/gfx-rs/wgpu/pull/4185) + ### Added/New Features @@ -112,6 +118,10 @@ By @wumpf in [#4147](https://github.com/gfx-rs/wgpu/pull/4147) - Don't bother calling `vkFreeCommandBuffers` when `vkDestroyCommandPool` will take care of that for us. By @jimblandy in [#4059](https://github.com/gfx-rs/wgpu/pull/4059) +#### DX12 + +- Bump `gpu-allocator` to 0.23. By @Elabajaba in [#4198](https://github.com/gfx-rs/wgpu/pull/4198) + ### Documentation - Use WGSL for VertexFormat example types. By @ScanMountGoat in [#4035](https://github.com/gfx-rs/wgpu/pull/4035) @@ -160,6 +170,31 @@ By @wumpf in [#4147](https://github.com/gfx-rs/wgpu/pull/4147) - Add an overview of `RenderPass` and how render state works. By @kpreid in [#4055](https://github.com/gfx-rs/wgpu/pull/4055) +## v0.17.2 (2023-10-03) + +### Bug Fixes + +#### Vulkan + +- Fix x11 hang while resizing on vulkan. @Azorlogh in [#4184](https://github.com/gfx-rs/wgpu/pull/4184). + +## v0.17.1 (2023-09-27) + +### Added/New Features + +- Add `get_mapped_range_as_array_buffer` for faster buffer read-backs in wasm builds. By @ryankaplan in [#4042] (https://github.com/gfx-rs/wgpu/pull/4042). + +### Bug Fixes + +#### DX12 + +- Fix panic on resize when using DX12. By @cwfitzgerald in [#4106](https://github.com/gfx-rs/wgpu/pull/4106) + +#### Vulkan + +- Suppress validation error caused by OBS layer. This was also fixed upstream. By @cwfitzgerald in [#4002](https://github.com/gfx-rs/wgpu/pull/4002) +- Work around bug in nvidia's vkCmdFillBuffer implementation. By @cwfitzgerald in [#4132](https://github.com/gfx-rs/wgpu/pull/4132). + ## v0.17.0 (2023-07-20) This is the first release that featured `wgpu-info` as a binary crate for getting information about what devices wgpu sees in your system. It can dump the information in both human readable format and json. diff --git a/Cargo.lock b/Cargo.lock index 60165e6b65..3c67d5ccbb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -130,9 +130,9 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.5.3" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f2db9467baa66a700abce2a18c5ad793f6f83310aca1284796fc3921d113fd" +checksum = "2c1da3ae8dabd9c00f453a329dfe1fb28da3c0a72e2478cdcd93171740c20499" dependencies = [ "async-lock", "async-task", @@ -1227,12 +1227,13 @@ dependencies = [ [[package]] name = "gpu-allocator" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce95f9e2e11c2c6fadfce42b5af60005db06576f231f5c92550fdded43c423e8" +checksum = "40fe17c8a05d60c38c0a4e5a3c802f2f1ceb66b76c67d96ffb34bef0475a7fad" dependencies = [ "backtrace", "log", + "presser", "thiserror", "winapi", "windows", @@ -1970,7 +1971,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -2098,6 +2099,12 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "presser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" + [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -3564,11 +3571,21 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.44.0" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ - "windows-targets 0.42.2", + "windows-core", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets 0.48.5", ] [[package]] @@ -3599,7 +3616,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -3619,17 +3636,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -3640,9 +3657,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -3658,9 +3675,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -3676,9 +3693,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -3694,9 +3711,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -3712,9 +3729,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -3724,9 +3741,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -3742,9 +3759,9 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winit" diff --git a/Cargo.toml b/Cargo.toml index d383788bc1..1f15a39be3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ default-members = [ [workspace.package] edition = "2021" -rust-version = "1.65" +rust-version = "1.70" keywords = ["graphics"] license = "MIT OR Apache-2.0" homepage = "https://wgpu.rs/" @@ -108,7 +108,7 @@ android_system_properties = "0.1.1" # DX dependencies bit-set = "0.5" -gpu-allocator = { version = "0.21", default_features = false, features = ["d3d12", "windows", "public-winapi"] } +gpu-allocator = { version = "0.23", default_features = false, features = ["d3d12", "public-winapi"] } d3d12 = "0.7.0" range-alloc = "0.1" winapi = "0.3" diff --git a/README.md b/README.md index 44e036a2b2..6f3fa73df9 100644 --- a/README.md +++ b/README.md @@ -95,8 +95,7 @@ We have a [wiki](https://github.com/gfx-rs/wgpu/wiki) that serves as a knowledge | Metal | | | :white_check_mark: | | DX12 | :white_check_mark: (W10+ only) | | | | DX11 | :hammer_and_wrench: | | | -| GLES3 | | :ok: | | -| Angle | :ok: | :ok: | :ok: (macOS only) | +| GLES3 | :ok: (angle) | :ok: | :ok: (angle; macOS only) | :white_check_mark: = First Class Support — :ok: = Best Effort Support — :hammer_and_wrench: = Unsupported, but support in progress diff --git a/examples/timestamp-queries/src/main.rs b/examples/timestamp-queries/src/main.rs index d463ea6579..b3939e2811 100644 --- a/examples/timestamp-queries/src/main.rs +++ b/examples/timestamp-queries/src/main.rs @@ -141,7 +141,7 @@ impl Queries { encoder.resolve_query_set( &self.set, // TODO(https://github.com/gfx-rs/wgpu/issues/3993): Musn't be larger than the number valid queries in the set. - 0..self.next_unused_query as u32, + 0..self.next_unused_query, &self.resolve_buffer, 0, ); diff --git a/player/Cargo.toml b/player/Cargo.toml index 5a6ea2bd7d..a379306ff8 100644 --- a/player/Cargo.toml +++ b/player/Cargo.toml @@ -10,10 +10,6 @@ keywords.workspace = true license.workspace = true publish = false -[features] -angle = ["wgc/angle"] -vulkan-portability = ["wgc/vulkan"] - [dependencies] env_logger.workspace = true log.workspace = true diff --git a/rust-toolchain b/rust-toolchain.toml similarity index 95% rename from rust-toolchain rename to rust-toolchain.toml index 0f2697d74a..03d64db162 100644 --- a/rust-toolchain +++ b/rust-toolchain.toml @@ -5,6 +5,6 @@ # to the user in the error, instead of "error: invalid channel name '[toolchain]'". [toolchain] -channel = "1.65" +channel = "1.70" components = ["rustfmt", "clippy"] targets = ["wasm32-unknown-unknown"] diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index 7fdec68a2f..6c0a3172d6 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -9,6 +9,12 @@ repository = "https://github.com/gfx-rs/wgpu" keywords = ["graphics"] license = "MIT OR Apache-2.0" +# Override the workspace's `rust-version` key. Firefox uses `cargo vendor` to +# copy the crates it actually uses out of the workspace, so it's meaningful for +# them to have less restrictive MSRVs individually than the workspace as a +# whole, if their code permits. See `../README.md` for details. +rust-version = "1.65" + [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] @@ -41,7 +47,6 @@ renderdoc = ["hal/renderdoc"] # Apply run-time checks, even in release builds. These are in addition # to the validation carried out at public APIs in all builds. strict_asserts = ["wgt/strict_asserts"] -angle = ["hal/gles"] # Enable API tracing trace = ["ron", "serde", "wgt/trace", "arrayvec/serde", "naga/serialize"] # Enable API replaying diff --git a/wgpu-hal/Cargo.toml b/wgpu-hal/Cargo.toml index 6a289a7c00..acc26e0624 100644 --- a/wgpu-hal/Cargo.toml +++ b/wgpu-hal/Cargo.toml @@ -13,7 +13,7 @@ license = "MIT OR Apache-2.0" # copy the crates it actually uses out of the workspace, so it's meaningful for # them to have less restrictive MSRVs individually than the workspace as a # whole, if their code permits. See `../README.md` for details. -rust-version = "1.60" +rust-version = "1.65" [package.metadata.docs.rs] # Ideally we would enable all the features. @@ -93,7 +93,7 @@ libloading = { version = ">=0.7, <0.9", optional = true } # backend: Dx12 bit-set = { version = "0.5", optional = true } range-alloc = { version = "0.1", optional = true } -gpu-allocator = { version = "0.22", default_features = false, features = ["d3d12", "windows", "public-winapi"], optional = true } +gpu-allocator = { version = "0.23", default_features = false, features = ["d3d12", "public-winapi"], optional = true } hassle-rs = { version = "0.10", optional = true } winapi = { version = "0.3", features = ["profileapi", "libloaderapi", "windef", "winuser", "dcomp"] } diff --git a/wgpu-hal/src/dx12/suballocation.rs b/wgpu-hal/src/dx12/suballocation.rs index 9625b2ae3a..3b9696e455 100644 --- a/wgpu-hal/src/dx12/suballocation.rs +++ b/wgpu-hal/src/dx12/suballocation.rs @@ -49,8 +49,9 @@ mod placed { let device = raw.as_ptr(); match gpu_allocator::d3d12::Allocator::new(&gpu_allocator::d3d12::AllocatorCreateDesc { - device: device.as_windows().clone(), + device: gpu_allocator::d3d12::ID3D12DeviceVersion::Device(device.as_windows().clone()), debug_settings: Default::default(), + allocation_sizes: gpu_allocator::AllocationSizes::default(), }) { Ok(allocator) => Ok(Some(Mutex::new(GpuAllocatorWrapper { allocator }))), Err(e) => { @@ -213,6 +214,7 @@ mod placed { log::error!("DX12 gpu-allocator: Internal Error: {}", e); Self::Lost } + gpu_allocator::AllocationError::BarrierLayoutNeedsDevice10 => todo!(), } } } diff --git a/wgpu-hal/src/vulkan/adapter.rs b/wgpu-hal/src/vulkan/adapter.rs index b515628726..2986777029 100644 --- a/wgpu-hal/src/vulkan/adapter.rs +++ b/wgpu-hal/src/vulkan/adapter.rs @@ -1223,6 +1223,8 @@ impl super::Adapter { let naga_options = { use naga::back::spv; + // The following capabilities are always available + // see https://registry.khronos.org/vulkan/specs/1.3-extensions/html/chap52.html#spirvenv-capabilities let mut capabilities = vec![ spv::Capability::Shader, spv::Capability::Matrix, @@ -1230,15 +1232,23 @@ impl super::Adapter { spv::Capability::Image1D, spv::Capability::ImageQuery, spv::Capability::DerivativeControl, - spv::Capability::SampledCubeArray, - spv::Capability::SampleRateShading, - //Note: this is requested always, no matter what the actual - // adapter supports. It's not the responsibility of SPV-out - // translation to handle the storage support for formats. spv::Capability::StorageImageExtendedFormats, - //TODO: fill out the rest ]; + if self + .downlevel_flags + .contains(wgt::DownlevelFlags::CUBE_ARRAY_TEXTURES) + { + capabilities.push(spv::Capability::SampledCubeArray); + } + + if self + .downlevel_flags + .contains(wgt::DownlevelFlags::MULTISAMPLED_SHADING) + { + capabilities.push(spv::Capability::SampleRateShading); + } + if features.contains(wgt::Features::MULTIVIEW) { capabilities.push(spv::Capability::MultiView); } diff --git a/wgpu-hal/src/vulkan/instance.rs b/wgpu-hal/src/vulkan/instance.rs index 18269fff77..2dda7a2c3a 100644 --- a/wgpu-hal/src/vulkan/instance.rs +++ b/wgpu-hal/src/vulkan/instance.rs @@ -157,6 +157,12 @@ impl super::Swapchain { /// - The device must have been made idle before calling this function. unsafe fn release_resources(self, device: &ash::Device) -> Self { profiling::scope!("Swapchain::release_resources"); + { + profiling::scope!("vkDeviceWaitIdle"); + // We need to also wait until all presentation work is done. Because there is no way to portably wait until + // the presentation work is done, we are forced to wait until the device is idle. + let _ = unsafe { device.device_wait_idle() }; + }; unsafe { device.destroy_fence(self.fence, None) }; self } diff --git a/wgpu-types/Cargo.toml b/wgpu-types/Cargo.toml index fd0abb0dc9..2b6c352982 100644 --- a/wgpu-types/Cargo.toml +++ b/wgpu-types/Cargo.toml @@ -9,6 +9,12 @@ repository = "https://github.com/gfx-rs/wgpu" keywords = ["graphics"] license = "MIT OR Apache-2.0" +# Override the workspace's `rust-version` key. Firefox uses `cargo vendor` to +# copy the crates it actually uses out of the workspace, so it's meaningful for +# them to have less restrictive MSRVs individually than the workspace as a +# whole, if their code permits. See `../README.md` for details. +rust-version = "1.65" + [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index e34e90235d..d494b9c023 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -34,30 +34,29 @@ glsl = ["naga/glsl-in"] wgsl = ["wgc?/wgsl"] trace = ["serde", "wgc/trace"] replay = ["serde", "wgc/replay"] -angle = ["wgc/angle"] -webgl = ["hal", "wgc"] +# Enables the GLES backend on Windows & macOS +angle = ["wgc/gles"] +webgl = ["hal", "wgc/gles"] +# Enables the Vulkan backend on macOS & iOS vulkan-portability = ["wgc/vulkan"] expose-ids = [] # Implement `Send` and `Sync` on Wasm. fragile-send-sync-non-atomic-wasm = ["hal/fragile-send-sync-non-atomic-wasm", "wgc/fragile-send-sync-non-atomic-wasm", "wgt/fragile-send-sync-non-atomic-wasm"] # wgpu-core is always available as an optional dependency, "wgc". -# Whenever wgpu-core is selected, we want the GLES backend and raw -# window handle support. +# Whenever wgpu-core is selected, we want raw window handle support. [dependencies.wgc] optional = true workspace = true -features = ["raw-window-handle", "gles"] +features = ["raw-window-handle"] # wgpu-core is required whenever not targeting web APIs directly. -# Whenever wgpu-core is selected, we want the GLES backend and raw -# window handle support. +# Whenever wgpu-core is selected, we want raw window handle support. [target.'cfg(any(not(target_arch = "wasm32"), target_os = "emscripten"))'.dependencies.wgc] workspace = true -features = ["raw-window-handle", "gles"] +features = ["raw-window-handle"] # We want the wgpu-core Metal backend on macOS and iOS. -# (We should consider also enabling "vulkan" for Vulkan Portability.) [target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies.wgc] workspace = true features = ["metal"] @@ -67,11 +66,16 @@ features = ["metal"] workspace = true features = ["dx11", "dx12"] -# We want the wgpu-core Vulkan backend on Unix (but not Emscripten) and Windows. +# We want the wgpu-core Vulkan backend on Unix (but not emscripten, macOS, iOS) and Windows. [target.'cfg(any(windows, all(unix, not(target_os = "emscripten"), not(target_os = "ios"), not(target_os = "macos"))))'.dependencies.wgc] workspace = true features = ["vulkan"] +# We want the wgpu-core GLES backend on Unix (but not macOS, iOS). +[target.'cfg(all(unix, not(target_os = "ios"), not(target_os = "macos")))'.dependencies.wgc] +workspace = true +features = ["gles"] + [dependencies.wgt] workspace = true