From f92d811aea16d09ecae1433531b484a554d540bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 21:35:02 -0500 Subject: [PATCH 1/7] chore(deps): bump crate-ci/typos from 1.29.4 to 1.29.5 (#7051) Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.29.4 to 1.29.5. - [Release notes](https://github.com/crate-ci/typos/releases) - [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md) - [Commits](https://github.com/crate-ci/typos/compare/v1.29.4...v1.29.5) --- updated-dependencies: - dependency-name: crate-ci/typos dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a53ad8a6bc..9a932ffcd3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -707,7 +707,7 @@ jobs: run: taplo format --check --diff - name: Check for typos - uses: crate-ci/typos@v1.29.4 + uses: crate-ci/typos@v1.29.5 check-cts-runner: # runtime is normally 2 minutes From ff4496b5d6011666bff6712258315a49af1fee5b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 23:01:08 -0500 Subject: [PATCH 2/7] chore(deps): bump the patch-updates group with 12 updates (#7052) Bumps the patch-updates group with 12 updates: | Package | From | To | | --- | --- | --- | | [serde_json](https://github.com/serde-rs/json) | `1.0.137` | `1.0.138` | | [syn](https://github.com/dtolnay/syn) | `2.0.96` | `2.0.98` | | [async-trait](https://github.com/dtolnay/async-trait) | `0.1.85` | `0.1.86` | | [bumpalo](https://github.com/fitzgen/bumpalo) | `3.16.0` | `3.17.0` | | [cc](https://github.com/rust-lang/cc-rs) | `1.2.10` | `1.2.11` | | [ryu](https://github.com/dtolnay/ryu) | `1.0.18` | `1.0.19` | | [toml_edit](https://github.com/toml-rs/toml) | `0.22.22` | `0.22.23` | | [unicode-ident](https://github.com/dtolnay/unicode-ident) | `1.0.15` | `1.0.16` | | [wayland-backend](https://github.com/smithay/wayland-rs) | `0.3.7` | `0.3.8` | | [wayland-scanner](https://github.com/smithay/wayland-rs) | `0.31.5` | `0.31.6` | | [wayland-sys](https://github.com/smithay/wayland-rs) | `0.31.5` | `0.31.6` | | [winnow](https://github.com/winnow-rs/winnow) | `0.6.24` | `0.7.0` | Updates `serde_json` from 1.0.137 to 1.0.138 - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.137...v1.0.138) Updates `syn` from 2.0.96 to 2.0.98 - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.96...2.0.98) Updates `async-trait` from 0.1.85 to 0.1.86 - [Release notes](https://github.com/dtolnay/async-trait/releases) - [Commits](https://github.com/dtolnay/async-trait/compare/0.1.85...0.1.86) Updates `bumpalo` from 3.16.0 to 3.17.0 - [Changelog](https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md) - [Commits](https://github.com/fitzgen/bumpalo/compare/3.16.0...3.17.0) Updates `cc` from 1.2.10 to 1.2.11 - [Release notes](https://github.com/rust-lang/cc-rs/releases) - [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md) - [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.10...cc-v1.2.11) Updates `ryu` from 1.0.18 to 1.0.19 - [Release notes](https://github.com/dtolnay/ryu/releases) - [Commits](https://github.com/dtolnay/ryu/compare/1.0.18...1.0.19) Updates `toml_edit` from 0.22.22 to 0.22.23 - [Commits](https://github.com/toml-rs/toml/compare/v0.22.22...v0.22.23) Updates `unicode-ident` from 1.0.15 to 1.0.16 - [Release notes](https://github.com/dtolnay/unicode-ident/releases) - [Commits](https://github.com/dtolnay/unicode-ident/compare/1.0.15...1.0.16) Updates `wayland-backend` from 0.3.7 to 0.3.8 - [Release notes](https://github.com/smithay/wayland-rs/releases) - [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md) - [Commits](https://github.com/smithay/wayland-rs/commits) Updates `wayland-scanner` from 0.31.5 to 0.31.6 - [Release notes](https://github.com/smithay/wayland-rs/releases) - [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md) - [Commits](https://github.com/smithay/wayland-rs/commits) Updates `wayland-sys` from 0.31.5 to 0.31.6 - [Release notes](https://github.com/smithay/wayland-rs/releases) - [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md) - [Commits](https://github.com/smithay/wayland-rs/commits) Updates `winnow` from 0.6.24 to 0.7.0 - [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md) - [Commits](https://github.com/winnow-rs/winnow/compare/v0.6.24...v0.7.0) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: async-trait dependency-type: indirect update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: bumpalo dependency-type: indirect update-type: version-update:semver-minor dependency-group: patch-updates - dependency-name: cc dependency-type: indirect update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: ryu dependency-type: indirect update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: toml_edit dependency-type: indirect update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: unicode-ident dependency-type: indirect update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: wayland-backend dependency-type: indirect update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: wayland-scanner dependency-type: indirect update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: wayland-sys dependency-type: indirect update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: winnow dependency-type: indirect update-type: version-update:semver-minor dependency-group: patch-updates ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 64 +++++++++++++++++++++++++++--------------------------- Cargo.toml | 2 +- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e84e45acf2..c3313f748a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -262,9 +262,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.85" +version = "0.1.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" +checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d" dependencies = [ "proc-macro2", "quote", @@ -446,9 +446,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "bytemuck" @@ -542,9 +542,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.10" +version = "1.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" +checksum = "e4730490333d58093109dc02c23174c3f4d490998c3fed3cc8e82d57afedb9cf" dependencies = [ "jobserver", "libc", @@ -1224,7 +1224,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -1916,7 +1916,7 @@ checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -2046,7 +2046,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -3027,9 +3027,9 @@ checksum = "afbdc74edc00b6f6a218ca6a5364d6226a259d4b8ea1af4a0ea063f27e179f4d" [[package]] name = "quick-xml" -version = "0.36.2" +version = "0.37.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe" +checksum = "165859e9e55f79d67b96c5d96f4e88b6f2695a1972849c15a6a3f5c59fc2c003" dependencies = [ "memchr", ] @@ -3246,7 +3246,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -3257,9 +3257,9 @@ checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" [[package]] name = "same-file" @@ -3345,9 +3345,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.137" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "indexmap", "itoa", @@ -3632,9 +3632,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.96" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", @@ -3830,9 +3830,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "02a8b472d1a3d7c18e2d61a489aee3453fd9031c33e4f55bd533f4a7adca1bee" dependencies = [ "indexmap", "serde", @@ -3908,7 +3908,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69fff37da548239c3bf9e64a12193d261e8b22b660991c6fd2df057c168f435f" dependencies = [ "cc", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -3981,9 +3981,9 @@ checksum = "2f322b60f6b9736017344fa0635d64be2f458fbc04eef65f6be22976dd1ffd5b" [[package]] name = "unicode-ident" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11cd88e12b17c6494200a9c1b683a04fcac9573ed74cd1b62aeb2727c5592243" +checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" [[package]] name = "unicode-segmentation" @@ -4212,9 +4212,9 @@ dependencies = [ [[package]] name = "wayland-backend" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "056535ced7a150d45159d3a8dc30f91a2e2d588ca0b23f70e56033622b8016f6" +checksum = "b7208998eaa3870dad37ec8836979581506e0c5c64c20c9e79e9d2a10d6f47bf" dependencies = [ "cc", "downcast-rs", @@ -4336,9 +4336,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.31.5" +version = "0.31.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597f2001b2e5fc1121e3d5b9791d3e78f05ba6bfa4641053846248e3a13661c3" +checksum = "896fdafd5d28145fce7958917d69f2fd44469b1d4e861cb5961bcbeebc6d1484" dependencies = [ "proc-macro2", "quick-xml", @@ -4347,9 +4347,9 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.31.5" +version = "0.31.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efa8ac0d8e8ed3e3b5c9fc92c7881406a268e11555abe36493efabe649a29e09" +checksum = "dbcebb399c77d5aa9fa5db874806ee7b4eba4e73650948e8f93963f128896615" dependencies = [ "dlib", "log", @@ -4678,7 +4678,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] @@ -5068,9 +5068,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.24" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" +checksum = "7e49d2d35d3fad69b39b94139037ecfb4f359f08958b9c11e7315ce770462419" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 381cbb4a3b..2aed77aa8a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -132,7 +132,7 @@ ron = "0.8" # see discussion here (including with some other alternatives): https://github.com/gfx-rs/wgpu/issues/6999 # (using default-features = false to support no-std build, avoiding any extra features that may require std::collections) rustc-hash = { version = "1", default-features = false } -serde_json = "1.0.137" +serde_json = "1.0.138" serde = { version = "1", default-features = false } smallvec = "1" static_assertions = "1.1.0" From d9e9c3aa195acacd236d4701a9c62185c555775e Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Mon, 3 Feb 2025 15:49:31 -0500 Subject: [PATCH 3/7] Fix Zero Sized Sampler Heap Issue (#7054) --- wgpu-hal/src/dx12/adapter.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/wgpu-hal/src/dx12/adapter.rs b/wgpu-hal/src/dx12/adapter.rs index 52ec89ebb9..ad37f6ad0b 100644 --- a/wgpu-hal/src/dx12/adapter.rs +++ b/wgpu-hal/src/dx12/adapter.rs @@ -212,7 +212,16 @@ impl super::Adapter { ) }; - if res.is_ok() { + // Sometimes on Windows 11 23H2, the function returns success, even though the runtime + // does not know about `Options19`. This can cause this number to be 0 as the structure isn't written to. + // This value is nonsense and creating zero-sized sampler heaps can cause drivers to explode. + // As as we're guaranteed 2048 anyway, we make sure this value is not under 2048. + // + // https://github.com/gfx-rs/wgpu/issues/7053 + let is_ok = res.is_ok(); + let is_above_minimum = features19.MaxSamplerDescriptorHeapSize + > Direct3D12::D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE; + if is_ok && is_above_minimum { max_sampler_descriptor_heap_size = features19.MaxSamplerDescriptorHeapSize; } }; From 9b76bcf12e291e8c7e2410ea83cb884f27e3d906 Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Wed, 5 Feb 2025 10:41:46 -0500 Subject: [PATCH 4/7] fix(dx12): query resource binding tier, not resource heap tier, for bindless feature check (#7059) --- wgpu-hal/src/dx12/adapter.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wgpu-hal/src/dx12/adapter.rs b/wgpu-hal/src/dx12/adapter.rs index ad37f6ad0b..8211fd9f94 100644 --- a/wgpu-hal/src/dx12/adapter.rs +++ b/wgpu-hal/src/dx12/adapter.rs @@ -154,8 +154,8 @@ impl super::Adapter { } .unwrap(); - if options.ResourceHeapTier == Direct3D12::D3D12_RESOURCE_HEAP_TIER_1 { - // We require Tier 2 for the ability to make samplers bindless in all cases. + if options.ResourceBindingTier.0 < Direct3D12::D3D12_RESOURCE_BINDING_TIER_2.0 { + // We require Tier 2 or higher for the ability to make samplers bindless in all cases. return None; } From 8fb94d9c08fd6fd1cd9b7524b260420668eb173d Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Thu, 30 Jan 2025 12:14:08 -0800 Subject: [PATCH 5/7] [naga] Require hashbrown's serde feature as a dev-dependency. Add `hashbrown` with the `"serde"` feature as a development dependency for Naga. Regardless of whether Naga's `deserialize` feature is enabled, the snapshot tests need to deserialize parameters saved in files as RON text. It would also suffice to use `std::collections::HashSet` in the snapshot tests, although we would need to build a `naga::FashHashSet` from the std `HashSet` at one point. Adding the dev-dependency seems slightly simpler. Fixes #7038. --- naga/Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/naga/Cargo.toml b/naga/Cargo.toml index d325866400..9cd92d1318 100644 --- a/naga/Cargo.toml +++ b/naga/Cargo.toml @@ -105,11 +105,12 @@ cfg_aliases.workspace = true [dev-dependencies] diff = "0.1" env_logger.workspace = true -itertools.workspace = true +hashbrown = { workspace = true, features = ["serde"] } # This _cannot_ have a version specified. If it does, crates.io will look # for a version of the package on crates when we publish naga. Path dependencies # are allowed through though. hlsl-snapshots = { path = "./hlsl-snapshots" } +itertools.workspace = true # Require at least version 0.7.1 of ron, this version changed how floating points are # serialized by forcing them to always have the decimal part, this makes it backwards # incompatible with our tests because we do a syntactic diff and not a semantic one. From d34707ec3feaf79278dd6eaf9b2ea59f9d6f0983 Mon Sep 17 00:00:00 2001 From: Vecvec <130132884+Vecvec@users.noreply.github.com> Date: Thu, 6 Feb 2025 06:23:22 +1300 Subject: [PATCH 6/7] Rename `instance_id` & `instance_custom_index` to `instance_index` & `instance_custom_data` (#6780) --- CHANGELOG.md | 2 ++ etc/specs/ray_tracing.md | 6 +++--- examples/features/src/ray_cube_compute/shader.wgsl | 4 ++-- examples/features/src/ray_scene/shader.wgsl | 8 ++++---- naga/src/back/hlsl/ray.rs | 8 ++++---- naga/src/front/type_gen.rs | 4 ++-- naga/tests/in/ray-query.wgsl | 4 ++-- naga/tests/out/hlsl/ray-query.hlsl | 12 ++++++------ naga/tests/out/msl/ray-query.msl | 4 ++-- player/src/lib.rs | 2 +- tests/tests/ray_tracing/shader.wgsl | 8 ++++---- wgpu-core/src/command/ray_tracing.rs | 8 ++++---- wgpu-core/src/ray_tracing.rs | 4 ++-- wgpu-hal/examples/ray-traced-triangle/main.rs | 2 +- wgpu-hal/src/dx12/device.rs | 2 +- wgpu-hal/src/lib.rs | 2 +- wgpu-hal/src/vulkan/device.rs | 2 +- wgpu-hal/src/vulkan/mod.rs | 2 +- wgpu/src/api/blas.rs | 8 ++++---- wgpu/src/backend/wgpu_core.rs | 2 +- 20 files changed, 48 insertions(+), 46 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 726efb6ade..892da037ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,8 @@ Bottom level categories: - Avoid using default features in many dependencies, etc. By Brody in [#7031](https://github.com/gfx-rs/wgpu/pull/7031) - Use `hashbrown` to simplify no-std support. By Brody in [#6938](https://github.com/gfx-rs/wgpu/pull/6938) & [#6925](https://github.com/gfx-rs/wgpu/pull/6925). - If you use Binding Arrays in a bind group, you may not use Dynamic Offset Buffers or Uniform Buffers in that bind group. By @cwfitzgerald in [#6811](https://github.com/gfx-rs/wgpu/pull/6811) +- Rename `instance_id` and `instance_custom_index` to `instance_index` and `instance_custom_data` by @Vecvec in + [#6780](https://github.com/gfx-rs/wgpu/pull/6780) ##### Refactored internal trace path parameter diff --git a/etc/specs/ray_tracing.md b/etc/specs/ray_tracing.md index f23b5305a2..64908c9c5f 100644 --- a/etc/specs/ray_tracing.md +++ b/etc/specs/ray_tracing.md @@ -109,11 +109,11 @@ struct RayIntersection { kind: u32, // Distance from starting point, measured in units of `RayDesc::dir`. t: f32, - // Corresponds to `instance.custom_index` where `instance` is the `TlasInstance` + // Corresponds to `instance.custom_data` where `instance` is the `TlasInstance` // that the intersected object was contained in. - instance_custom_index: u32, + instance_custom_data: u32, // The index into the `TlasPackage` to get the `TlasInstance` that the hit object is in - instance_id: u32, + instance_index: u32, // The offset into the shader binding table. Currently, this value is always 0. sbt_record_offset: u32, // The index into the `Blas`'s build descriptor (e.g. if `BlasBuildEntry::geometry` is diff --git a/examples/features/src/ray_cube_compute/shader.wgsl b/examples/features/src/ray_cube_compute/shader.wgsl index 79ee7ad7e5..cba6e1f848 100644 --- a/examples/features/src/ray_cube_compute/shader.wgsl +++ b/examples/features/src/ray_cube_compute/shader.wgsl @@ -29,8 +29,8 @@ struct RayDesc { struct RayIntersection { kind: u32, t: f32, - instance_custom_index: u32, - instance_id: u32, + instance_custom_data: u32, + instance_index: u32, sbt_record_offset: u32, geometry_index: u32, primitive_index: u32, diff --git a/examples/features/src/ray_scene/shader.wgsl b/examples/features/src/ray_scene/shader.wgsl index 4e16bd9453..496125ea5c 100644 --- a/examples/features/src/ray_scene/shader.wgsl +++ b/examples/features/src/ray_scene/shader.wgsl @@ -52,8 +52,8 @@ struct RayDesc { struct RayIntersection { kind: u32, t: f32, - instance_custom_index: u32, - instance_id: u32, + instance_custom_data: u32, + instance_index: u32, sbt_record_offset: u32, geometry_index: u32, primitive_index: u32, @@ -131,7 +131,7 @@ fn fs_main(vertex: VertexOutput) -> @location(0) vec4 { let intersection = rayQueryGetCommittedIntersection(&rq); if (intersection.kind != RAY_QUERY_INTERSECTION_NONE) { - let instance = instances[intersection.instance_custom_index]; + let instance = instances[intersection.instance_custom_data]; let geometry = geometries[intersection.geometry_index + instance.first_geometry]; let index_offset = geometry.first_index; @@ -155,7 +155,7 @@ fn fs_main(vertex: VertexOutput) -> @location(0) vec4 { color = vec4(material.albedo, 1.0); - if(intersection.instance_custom_index == 1u){ + if(intersection.instance_custom_data == 1u){ color = vec4(normal, 1.0); } } diff --git a/naga/src/back/hlsl/ray.rs b/naga/src/back/hlsl/ray.rs index ab57f06a6c..6f797c7eb4 100644 --- a/naga/src/back/hlsl/ray.rs +++ b/naga/src/back/hlsl/ray.rs @@ -42,11 +42,11 @@ impl super::Writer<'_, W> { writeln!(self.out, " ret.t = rq.CommittedRayT();")?; writeln!( self.out, - " ret.instance_custom_index = rq.CommittedInstanceID();" + " ret.instance_custom_data = rq.CommittedInstanceID();" )?; writeln!( self.out, - " ret.instance_id = rq.CommittedInstanceIndex();" + " ret.instance_index = rq.CommittedInstanceIndex();" )?; writeln!( self.out, @@ -129,11 +129,11 @@ impl super::Writer<'_, W> { writeln!( self.out, - " ret.instance_custom_index = rq.CandidateInstanceID();" + " ret.instance_custom_data = rq.CandidateInstanceID();" )?; writeln!( self.out, - " ret.instance_id = rq.CandidateInstanceIndex();" + " ret.instance_index = rq.CandidateInstanceIndex();" )?; writeln!( self.out, diff --git a/naga/src/front/type_gen.rs b/naga/src/front/type_gen.rs index 737c456bbd..2e75076239 100644 --- a/naga/src/front/type_gen.rs +++ b/naga/src/front/type_gen.rs @@ -180,13 +180,13 @@ impl crate::Module { offset: 4, }, crate::StructMember { - name: Some("instance_custom_index".to_string()), + name: Some("instance_custom_data".to_string()), ty: ty_flag, binding: None, offset: 8, }, crate::StructMember { - name: Some("instance_id".to_string()), + name: Some("instance_index".to_string()), ty: ty_flag, binding: None, offset: 12, diff --git a/naga/tests/in/ray-query.wgsl b/naga/tests/in/ray-query.wgsl index 9f94356b83..0ed1606c05 100644 --- a/naga/tests/in/ray-query.wgsl +++ b/naga/tests/in/ray-query.wgsl @@ -28,8 +28,8 @@ struct RayDesc { struct RayIntersection { kind: u32, t: f32, - instance_custom_index: u32, - instance_id: u32, + instance_custom_data: u32, + instance_index: u32, sbt_record_offset: u32, geometry_index: u32, primitive_index: u32, diff --git a/naga/tests/out/hlsl/ray-query.hlsl b/naga/tests/out/hlsl/ray-query.hlsl index 4815d27c9a..69c616ef87 100644 --- a/naga/tests/out/hlsl/ray-query.hlsl +++ b/naga/tests/out/hlsl/ray-query.hlsl @@ -1,8 +1,8 @@ struct RayIntersection { uint kind; float t; - uint instance_custom_index; - uint instance_id; + uint instance_custom_data; + uint instance_index; uint sbt_record_offset; uint geometry_index; uint primitive_index; @@ -64,8 +64,8 @@ RayIntersection GetCommittedIntersection(RayQuery rq) { ret.kind = rq.CommittedStatus(); if( rq.CommittedStatus() == COMMITTED_NOTHING) {} else { ret.t = rq.CommittedRayT(); - ret.instance_custom_index = rq.CommittedInstanceID(); - ret.instance_id = rq.CommittedInstanceIndex(); + ret.instance_custom_data = rq.CommittedInstanceID(); + ret.instance_index = rq.CommittedInstanceIndex(); ret.sbt_record_offset = rq.CommittedInstanceContributionToHitGroupIndex(); ret.geometry_index = rq.CommittedGeometryIndex(); ret.primitive_index = rq.CommittedPrimitiveIndex(); @@ -131,8 +131,8 @@ RayIntersection GetCandidateIntersection(RayQuery rq) { } else { ret.kind = 3; } - ret.instance_custom_index = rq.CandidateInstanceID(); - ret.instance_id = rq.CandidateInstanceIndex(); + ret.instance_custom_data = rq.CandidateInstanceID(); + ret.instance_index = rq.CandidateInstanceIndex(); ret.sbt_record_offset = rq.CandidateInstanceContributionToHitGroupIndex(); ret.geometry_index = rq.CandidateGeometryIndex(); ret.primitive_index = rq.CandidatePrimitiveIndex(); diff --git a/naga/tests/out/msl/ray-query.msl b/naga/tests/out/msl/ray-query.msl index 58927b1f12..37e63a6cd4 100644 --- a/naga/tests/out/msl/ray-query.msl +++ b/naga/tests/out/msl/ray-query.msl @@ -16,8 +16,8 @@ constexpr metal::uint _map_intersection_type(const metal::raytracing::intersecti struct RayIntersection { uint kind; float t; - uint instance_custom_index; - uint instance_id; + uint instance_custom_data; + uint instance_index; uint sbt_record_offset; uint geometry_index; uint primitive_index; diff --git a/player/src/lib.rs b/player/src/lib.rs index 35820d71db..ccf1f5a473 100644 --- a/player/src/lib.rs +++ b/player/src/lib.rs @@ -194,7 +194,7 @@ impl GlobalPlay for wgc::global::Global { .map(|instance| wgc::ray_tracing::TlasInstance { blas_id: instance.blas_id, transform: &instance.transform, - custom_index: instance.custom_index, + custom_data: instance.custom_data, mask: instance.mask, }) }); diff --git a/tests/tests/ray_tracing/shader.wgsl b/tests/tests/ray_tracing/shader.wgsl index ddb3505e75..2130b8d9ae 100644 --- a/tests/tests/ray_tracing/shader.wgsl +++ b/tests/tests/ray_tracing/shader.wgsl @@ -4,8 +4,8 @@ var acc_struct: acceleration_structure; struct Intersection { kind: u32, t: f32, - instance_custom_index: u32, - instance_id: u32, + instance_custom_data: u32, + instance_index: u32, sbt_record_offset: u32, geometry_index: u32, primitive_index: u32, @@ -38,8 +38,8 @@ fn all_of_struct() { out = Intersection( intersection.kind, intersection.t, - intersection.instance_custom_index, - intersection.instance_id, + intersection.instance_custom_data, + intersection.instance_index, intersection.sbt_record_offset, intersection.geometry_index, intersection.primitive_index, diff --git a/wgpu-core/src/command/ray_tracing.rs b/wgpu-core/src/command/ray_tracing.rs index 2e6d2f66cf..498b37d07b 100644 --- a/wgpu-core/src/command/ray_tracing.rs +++ b/wgpu-core/src/command/ray_tracing.rs @@ -396,7 +396,7 @@ impl Global { instance.map(|instance| TraceTlasInstance { blas_id: instance.blas_id, transform: *instance.transform, - custom_index: instance.custom_index, + custom_data: instance.custom_data, mask: instance.mask, }) }) @@ -444,7 +444,7 @@ impl Global { instance.as_ref().map(|instance| TlasInstance { blas_id: instance.blas_id, transform: &instance.transform, - custom_index: instance.custom_index, + custom_data: instance.custom_data, mask: instance.mask, }) }); @@ -512,7 +512,7 @@ impl Global { let mut instance_count = 0; for instance in package.instances.flatten() { - if instance.custom_index >= (1u32 << 24u32) { + if instance.custom_data >= (1u32 << 24u32) { return Err(BuildAccelerationStructureError::TlasInvalidCustomIndex( tlas.error_ident(), )); @@ -524,7 +524,7 @@ impl Global { instance_buffer_staging_source.extend(device.raw().tlas_instance_to_bytes( hal::TlasInstance { transform: *instance.transform, - custom_index: instance.custom_index, + custom_data: instance.custom_data, mask: instance.mask, blas_address: blas.handle, }, diff --git a/wgpu-core/src/ray_tracing.rs b/wgpu-core/src/ray_tracing.rs index fe6a1f7f6a..5414811d88 100644 --- a/wgpu-core/src/ray_tracing.rs +++ b/wgpu-core/src/ray_tracing.rs @@ -175,7 +175,7 @@ pub struct TlasBuildEntry { pub struct TlasInstance<'a> { pub blas_id: BlasId, pub transform: &'a [f32; 12], - pub custom_index: u32, + pub custom_data: u32, pub mask: u8, } @@ -243,7 +243,7 @@ pub struct TraceBlasBuildEntry { pub struct TraceTlasInstance { pub blas_id: BlasId, pub transform: [f32; 12], - pub custom_index: u32, + pub custom_data: u32, pub mask: u8, } diff --git a/wgpu-hal/examples/ray-traced-triangle/main.rs b/wgpu-hal/examples/ray-traced-triangle/main.rs index 79984ae43e..24f9c8b87d 100644 --- a/wgpu-hal/examples/ray-traced-triangle/main.rs +++ b/wgpu-hal/examples/ray-traced-triangle/main.rs @@ -33,7 +33,7 @@ impl std::fmt::Debug for AccelerationStructureInstance { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("Instance") .field("transform", &self.transform) - .field("custom_index()", &self.custom_index()) + .field("custom_data()", &self.custom_index()) .field("mask()", &self.mask()) .field( "shader_binding_table_record_offset()", diff --git a/wgpu-hal/src/dx12/device.rs b/wgpu-hal/src/dx12/device.rs index 2d617eb299..acc000decc 100644 --- a/wgpu-hal/src/dx12/device.rs +++ b/wgpu-hal/src/dx12/device.rs @@ -2316,7 +2316,7 @@ impl crate::Device for super::Device { const MAX_U24: u32 = (1u32 << 24u32) - 1u32; let temp = Direct3D12::D3D12_RAYTRACING_INSTANCE_DESC { Transform: instance.transform, - _bitfield1: (instance.custom_index & MAX_U24) | (u32::from(instance.mask) << 24), + _bitfield1: (instance.custom_data & MAX_U24) | (u32::from(instance.mask) << 24), _bitfield2: 0, AccelerationStructure: instance.blas_address, }; diff --git a/wgpu-hal/src/lib.rs b/wgpu-hal/src/lib.rs index 997119b79c..fd5f272b61 100644 --- a/wgpu-hal/src/lib.rs +++ b/wgpu-hal/src/lib.rs @@ -2444,7 +2444,7 @@ pub struct AccelerationStructureBarrier { #[derive(Debug, Copy, Clone)] pub struct TlasInstance { pub transform: [f32; 12], - pub custom_index: u32, + pub custom_data: u32, pub mask: u8, pub blas_address: u64, } diff --git a/wgpu-hal/src/vulkan/device.rs b/wgpu-hal/src/vulkan/device.rs index bba28939f7..e17f211b05 100644 --- a/wgpu-hal/src/vulkan/device.rs +++ b/wgpu-hal/src/vulkan/device.rs @@ -2569,7 +2569,7 @@ impl crate::Device for super::Device { const MAX_U24: u32 = (1u32 << 24u32) - 1u32; let temp = RawTlasInstance { transform: instance.transform, - custom_index_and_mask: (instance.custom_index & MAX_U24) + custom_data_and_mask: (instance.custom_data & MAX_U24) | (u32::from(instance.mask) << 24), shader_binding_table_record_offset_and_flags: 0, acceleration_structure_reference: instance.blas_address, diff --git a/wgpu-hal/src/vulkan/mod.rs b/wgpu-hal/src/vulkan/mod.rs index 4421d0a5ef..ed8dfc39d3 100644 --- a/wgpu-hal/src/vulkan/mod.rs +++ b/wgpu-hal/src/vulkan/mod.rs @@ -1480,7 +1480,7 @@ fn get_lost_err() -> crate::DeviceError { #[repr(C)] struct RawTlasInstance { transform: [f32; 12], - custom_index_and_mask: u32, + custom_data_and_mask: u32, shader_binding_table_record_offset_and_flags: u32, acceleration_structure_reference: u64, } diff --git a/wgpu/src/api/blas.rs b/wgpu/src/api/blas.rs index 8f681f17d5..ed7a14e331 100644 --- a/wgpu/src/api/blas.rs +++ b/wgpu/src/api/blas.rs @@ -49,7 +49,7 @@ pub struct TlasInstance { /// /// This must only use the lower 24 bits, if any bits are outside that range (byte 4 does not equal 0) the TlasInstance becomes /// invalid and generates a validation error when built - pub custom_index: u32, + pub custom_data: u32, /// Mask for the instance used inside the shader to filter instances. /// Reports hit only if `(shader_cull_mask & tlas_instance.mask) != 0u`. pub mask: u8, @@ -59,7 +59,7 @@ impl TlasInstance { /// Construct TlasInstance. /// - blas: Reference to the bottom level acceleration structure /// - transform: Transform buffer offset in bytes (optional, required if transform buffer is present) - /// - custom_index: Custom index for the instance used inside the shader (max 24 bits) + /// - custom_data: Custom index for the instance used inside the shader (max 24 bits) /// - mask: Mask for the instance used inside the shader to filter instances /// /// Note: while one of these contains a reference to a BLAS that BLAS will not be dropped, @@ -67,11 +67,11 @@ impl TlasInstance { /// TlasInstance(s) will immediately make them invalid. If one or more of those invalid /// TlasInstances is inside a TlasPackage that is attempted to be built, the build will /// generate a validation error. - pub fn new(blas: &Blas, transform: [f32; 12], custom_index: u32, mask: u8) -> Self { + pub fn new(blas: &Blas, transform: [f32; 12], custom_data: u32, mask: u8) -> Self { Self { blas: blas.inner.clone(), transform, - custom_index, + custom_data, mask, } } diff --git a/wgpu/src/backend/wgpu_core.rs b/wgpu/src/backend/wgpu_core.rs index 36438abfdc..64203914c4 100644 --- a/wgpu/src/backend/wgpu_core.rs +++ b/wgpu/src/backend/wgpu_core.rs @@ -2522,7 +2522,7 @@ impl dispatch::CommandEncoderInterface for CoreCommandEncoder { .map(|instance| wgc::ray_tracing::TlasInstance { blas_id: instance.blas.as_core().id, transform: &instance.transform, - custom_index: instance.custom_index, + custom_data: instance.custom_data, mask: instance.mask, }) }); From 426882403dd0a67eacdaf7cca1720f860f03bbb0 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Wed, 5 Feb 2025 09:37:15 -0800 Subject: [PATCH 7/7] Fix time for wgpu maintainers meeting. (#7060) Change the time from UTC to US EST. UTC is not affected by US daylight savings time, but the current understanding is that our meeting time is affected. In the maintainers meeting, we confirmed that this was okay for the European attendees (some have other US DST-affected meetings afterwards) but of course everything can be revisited as needed. --- CONTRIBUTING.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eacf57549e..e1fc71df35 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,8 +44,10 @@ The WGPU project has multiple official platforms for community engagement: - `wgpu` Maintainership Meetings: Every week, the maintainership of the wgpu project meets to discuss the project's direction and review ongoing work. These meetings are open to the public, and you are welcome to attend. They - happen on Google Meet and happen on Wednesday at 16:00 UTC and last approximately - an hour. Remember to obey the [`CODE_OF_CONDUCT.md`] in the meeting. + happen on Google Meet and happen on Wednesday at 11:00 US Eastern Standard + Time and last approximately an hour. Remember to obey the + [`CODE_OF_CONDUCT.md`] in the meeting. + - [Meeting Notes] - [Meeting Link] - [GitHub discussions]: TODO: Experimentally used by some enthusiastic members