Skip to content

Commit

Permalink
Merge branch 'trunk' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
gents83 authored Sep 8, 2023
2 parents 7394fd7 + 9a91953 commit c235de4
Show file tree
Hide file tree
Showing 52 changed files with 1,185 additions and 573 deletions.
7 changes: 0 additions & 7 deletions .cargo/config.toml

This file was deleted.

17 changes: 9 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:

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

- name: Install MSRV toolchain
run: |
Expand Down Expand Up @@ -181,7 +181,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install wasm-pack
uses: taiki-e/install-action@v2
Expand Down Expand Up @@ -219,7 +219,7 @@ jobs:

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
Expand Down Expand Up @@ -284,6 +284,7 @@ jobs:
done
- uses: actions/upload-artifact@v3
if: always() # We want artifacts even if the tests fail.
with:
name: comparison-images
path: |
Expand All @@ -308,7 +309,7 @@ jobs:

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

- name: disable debug
shell: bash
Expand All @@ -335,7 +336,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: run rustfmt
run: |
Expand All @@ -346,7 +347,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install MSRV toolchain
run: |
Expand Down Expand Up @@ -375,7 +376,7 @@ jobs:
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
Expand All @@ -389,7 +390,7 @@ jobs:
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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

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

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
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

Expand Down
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,31 @@ By @Valaphee in [#3402](https://github.com/gfx-rs/wgpu/pull/3402)

### Changes

#### General

- Omit texture store bound checks since they are no-ops if out of bounds on all APIs. By @teoxoy in [#3975](https://github.com/gfx-rs/wgpu/pull/3975)
- Validate `DownlevelFlags::READ_ONLY_DEPTH_STENCIL`. By @teoxoy in [#4031](https://github.com/gfx-rs/wgpu/pull/4031)
- Add validation in accordance with WebGPU `setViewport` valid usage for `x`, `y` and `this.[[attachment_size]]`. By @James2022-rgb in [#4058](https://github.com/gfx-rs/wgpu/pull/4058)
- `wgpu::CreateSurfaceError` now gives details of the failure, but no longer implements `PartialEq`. By @kpreid in [#4066](https://github.com/gfx-rs/wgpu/pull/4066)
- Make `WGPU_POWER_PREF=none` a valid value. By @fornwall in [4076](https://github.com/gfx-rs/wgpu/pull/4076)

#### Vulkan

- Rename `wgpu_hal::vulkan::Instance::required_extensions` to `desired_extensions`. By @jimblandy in [#4115](https://github.com/gfx-rs/wgpu/pull/4115)

- 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)


### Documentation
- Use WGSL for VertexFormat example types. By @ScanMountGoat in [#4305](https://github.com/gfx-rs/wgpu/pull/4035)

### Bug Fixes

#### General

- Derive storage bindings via `naga::StorageAccess` instead of `naga::GlobalUse`. By @teoxoy in [#3985](https://github.com/gfx-rs/wgpu/pull/3985).
- `Queue::on_submitted_work_done` callbacks will now always be called after all previous `BufferSlice::map_async` callbacks, even when there are no active submissions. By @cwfitzgerald in [#4036](https://github.com/gfx-rs/wgpu/pull/4036).
- Fix `clear` texture views being leaked when `wgpu::SurfaceTexture` is dropped before it is presented. By @rajveermalviya in [#4057](https://github.com/gfx-rs/wgpu/pull/4057).

#### Vulkan
- Fix enabling `wgpu::Features::PARTIALLY_BOUND_BINDING_ARRAY` not being actually enabled in vulkan backend. By @39ali in[#3772](https://github.com/gfx-rs/wgpu/pull/3772).
Expand All @@ -96,11 +105,25 @@ By @Valaphee in [#3402](https://github.com/gfx-rs/wgpu/pull/3402)

- Enhancement of [#4038], using ash's definition instead of hard-coded c_str. By @hybcloud in[#4044](https://github.com/gfx-rs/wgpu/pull/4044).

- Enable vulkan presentation on (Linux) Intel Mesa >= v21.2. By @flukejones in[#4110](https://github.com/gfx-rs/wgpu/pull/4110)

#### DX12

- DX12 doesn't support `Features::POLYGON_MODE_POINT``. By @teoxoy in [#4032](https://github.com/gfx-rs/wgpu/pull/4032).
- Set `Features::VERTEX_WRITABLE_STORAGE` based on the right feature level. By @teoxoy in [#4033](https://github.com/gfx-rs/wgpu/pull/4033).

#### Metal

- Ensure that MTLCommandEncoder calls endEncoding before it is deallocated. By @bradwerth in [#4023](https://github.com/gfx-rs/wgpu/pull/4023)

#### WebGPU

- Ensure that limit requests and reporting is done correctly. By @OptimisticPeach in [#4107](https://github.com/gfx-rs/wgpu/pull/4107)

#### Testing

- Skip `test_multithreaded_compute` on MoltenVK. By @jimblandy in [#4096](https://github.com/gfx-rs/wgpu/pull/4096).

### Documentation

- Add an overview of `RenderPass` and how render state works. By @kpreid in [#4055](https://github.com/gfx-rs/wgpu/pull/4055)
Expand All @@ -115,7 +138,7 @@ This release was fairly minor as breaking changes go.

#### `wgpu` types now `!Send` `!Sync` on wasm

Up until this point, wgpu has made the assumption that threads do not exist on wasm. With the rise of libraries like [`wasm_thread`](https://crates.io/crates/wasm_thread) making it easier and easier to do wasm multithreading this assumption is no longer sound. As all wgpu objects contain references into the JS heap, they cannot leave the thread they started on.
Up until this point, wgpu has made the assumption that threads do not exist on wasm. With the rise of libraries like [`wasm_thread`](https://crates.io/crates/wasm_thread) making it easier and easier to do wasm multithreading this assumption is no longer sound. As all wgpu objects contain references into the JS heap, they cannot leave the thread they started on.

As we understand that this change might be very inconvenient for users who don't care about wasm threading, there is a crate feature which re-enables the old behavior: `fragile-send-sync-non-atomic-wasm`. So long as you don't compile your code with `-Ctarget-feature=+atomics`, `Send` and `Sync` will be implemented again on wgpu types on wasm. As the name implies, especially for libraries, this is very fragile, as you don't know if a user will want to compile with atomics (and therefore threads) or not.

Expand Down
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ arrayvec = "0.7"
async-executor = "1"
bitflags = "2"
bit-vec = "0.6"
bytemuck = { version = "1.13", features = ["derive"] }
bytemuck = { version = "1.14", features = ["derive"] }
cfg_aliases = "0.1"
cfg-if = "1"
codespan-reporting = "0.11"
Expand Down
2 changes: 1 addition & 1 deletion examples/boids/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ fn boids() {
.downlevel_flags(wgpu::DownlevelFlags::COMPUTE_SHADERS)
.limits(wgpu::Limits::downlevel_defaults())
// Lots of validation errors, maybe related to https://github.com/gfx-rs/wgpu/issues/3160
.molten_vk_failure(),
.expect_fail(wgpu_test::FailureCase::molten_vk()),
comparisons: &[wgpu_test::ComparisonType::Mean(0.005)],
});
}
2 changes: 1 addition & 1 deletion examples/common/src/framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ pub fn test<E: Example>(mut params: FrameworkRefTest) {

wgpu_test::image::compare_image_output(
env!("CARGO_MANIFEST_DIR").to_string() + "/../../" + params.image_path,
ctx.adapter_info.backend,
&ctx.adapter_info,
params.width,
params.height,
&bytes,
Expand Down
23 changes: 11 additions & 12 deletions examples/hello-compute/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::sync::Arc;

use super::*;
use wgpu_test::{initialize_test, TestParameters};
use wgpu_test::{initialize_test, FailureCase, TestParameters};

wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);

Expand All @@ -13,7 +13,7 @@ fn test_compute_1() {
.downlevel_flags(wgpu::DownlevelFlags::COMPUTE_SHADERS)
.limits(wgpu::Limits::downlevel_defaults())
.features(wgpu::Features::TIMESTAMP_QUERY)
.specific_failure(None, None, Some("V3D"), true),
.skip(FailureCase::adapter("V3D")),
|ctx| {
let input = &[1, 2, 3, 4];

Expand All @@ -35,7 +35,7 @@ fn test_compute_2() {
.downlevel_flags(wgpu::DownlevelFlags::COMPUTE_SHADERS)
.limits(wgpu::Limits::downlevel_defaults())
.features(wgpu::Features::TIMESTAMP_QUERY)
.specific_failure(None, None, Some("V3D"), true),
.skip(FailureCase::adapter("V3D")),
|ctx| {
let input = &[5, 23, 10, 9];

Expand All @@ -57,7 +57,7 @@ fn test_compute_overflow() {
.downlevel_flags(wgpu::DownlevelFlags::COMPUTE_SHADERS)
.limits(wgpu::Limits::downlevel_defaults())
.features(wgpu::Features::TIMESTAMP_QUERY)
.specific_failure(None, None, Some("V3D"), true),
.skip(FailureCase::adapter("V3D")),
|ctx| {
let input = &[77031, 837799, 8400511, 63728127];
pollster::block_on(assert_execute_gpu(
Expand All @@ -78,16 +78,15 @@ fn test_multithreaded_compute() {
.downlevel_flags(wgpu::DownlevelFlags::COMPUTE_SHADERS)
.limits(wgpu::Limits::downlevel_defaults())
.features(wgpu::Features::TIMESTAMP_QUERY)
.specific_failure(None, None, Some("V3D"), true)
.skip(FailureCase::adapter("V3D"))
// https://github.com/gfx-rs/wgpu/issues/3944
.specific_failure(
Some(wgpu::Backends::VULKAN),
None,
Some("swiftshader"),
true,
)
.skip(FailureCase::backend_adapter(
wgpu::Backends::VULKAN,
"swiftshader",
))
// https://github.com/gfx-rs/wgpu/issues/3250
.specific_failure(Some(wgpu::Backends::GL), None, Some("llvmpipe"), true),
.skip(FailureCase::backend_adapter(wgpu::Backends::GL, "llvmpipe"))
.skip(FailureCase::molten_vk()),
|ctx| {
use std::{sync::mpsc, thread, time::Duration};

Expand Down
4 changes: 2 additions & 2 deletions examples/mipmap/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ fn mipmap() {
height: 768,
optional_features: wgpu::Features::default(),
base_test_parameters: wgpu_test::TestParameters::default()
.backend_failure(wgpu::Backends::GL),
.expect_fail(wgpu_test::FailureCase::backend(wgpu::Backends::GL)),
comparisons: &[wgpu_test::ComparisonType::Mean(0.02)],
});
}
Expand All @@ -535,7 +535,7 @@ fn mipmap_query() {
height: 768,
optional_features: QUERY_FEATURES,
base_test_parameters: wgpu_test::TestParameters::default()
.backend_failure(wgpu::Backends::GL),
.expect_fail(wgpu_test::FailureCase::backend(wgpu::Backends::GL)),
comparisons: &[wgpu_test::ComparisonType::Mean(0.02)],
});
}
9 changes: 8 additions & 1 deletion examples/msaa-line/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ use std::{borrow::Cow, iter};
use bytemuck::{Pod, Zeroable};
use wgpu::util::DeviceExt;

#[cfg(test)]
use wgpu_test::FailureCase;

#[repr(C)]
#[derive(Clone, Copy, Pod, Zeroable)]
struct Vertex {
Expand Down Expand Up @@ -326,7 +329,11 @@ fn msaa_line() {
optional_features: wgpu::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES,
base_test_parameters: wgpu_test::TestParameters::default()
// AMD seems to render nothing on DX12 https://github.com/gfx-rs/wgpu/issues/3838
.specific_failure(Some(wgpu::Backends::DX12), Some(0x1002), None, false),
.expect_fail(FailureCase {
backends: Some(wgpu::Backends::DX12),
vendor: Some(0x1002),
..FailureCase::default()
}),
// There's a lot of natural variance so we check the weighted median too to differentiate
// real failures from variance.
comparisons: &[
Expand Down
10 changes: 8 additions & 2 deletions examples/shadow/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -857,9 +857,15 @@ fn shadow() {
base_test_parameters: wgpu_test::TestParameters::default()
.downlevel_flags(wgpu::DownlevelFlags::COMPARISON_SAMPLERS)
// rpi4 on VK doesn't work: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3916
.specific_failure(Some(wgpu::Backends::VULKAN), None, Some("V3D"), false)
.expect_fail(wgpu_test::FailureCase::backend_adapter(
wgpu::Backends::VULKAN,
"V3D",
))
// llvmpipe versions in CI are flaky: https://github.com/gfx-rs/wgpu/issues/2594
.specific_failure(Some(wgpu::Backends::VULKAN), None, Some("llvmpipe"), true),
.skip(wgpu_test::FailureCase::backend_adapter(
wgpu::Backends::VULKAN,
"llvmpipe",
)),
comparisons: &[wgpu_test::ComparisonType::Mean(0.02)],
});
}
Loading

0 comments on commit c235de4

Please sign in to comment.