8689 Commits

Author SHA1 Message Date
Connor Fitzgerald
dcdb10348b
Add Flush to GL Queue::submit (#6941) 2025-01-18 15:02:42 -05:00
Erich Gubler
3b3e1939f9
Eliminate overflow in query set bounds checks (#6933) 2025-01-17 16:36:22 +00:00
sotaroikeda
3d13cc1bbe
Add a way to notify with Queue::submit() to Vulkan's vk::Semaphore allocated outside of wgpu (#6813)
Co-authored-by: Sotaro Ikeda <you@example.com>
2025-01-17 11:18:17 -05:00
Alphyr
aa94634524
Implement Clone for ShaderModule (#6937) 2025-01-17 10:39:47 -05:00
Vecvec
bdef8c0407
[spirv] Stop naga causing undefined behavior in rayQueryGet*Intersection (#6752)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-17 00:04:33 +00:00
Andreas Reich
d5d5157b5d
Add "Most objects in wgpu are now Clone" to highlight section (#6930) 2025-01-16 11:13:04 -05:00
@brodycj - C. Jonathan Brody
beb33414c7
trace directory path updates (#6924)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-16 14:50:15 +00:00
@brodycj - C. Jonathan Brody
623f143a82
Start using hashbrown (#6925) 2025-01-16 14:53:36 +01:00
Connor Fitzgerald
779261e64d
Release v24 (#6923) v24.0.0 2025-01-15 16:29:22 -05:00
caelunshun
30364134f3
Expose conversions between TextureFormat and naga::StorageFormat (#6185)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-15 17:44:14 +00:00
Connor Fitzgerald
0f37714fb8
Separate Out Backend Options into Individual Structs (#6895) 2025-01-15 17:32:15 +00:00
Kent Slaney
a32467041d
fix >= in template list matching for a<b>=c (#6898)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-15 17:25:04 +00:00
atlv
be95178709
64 bit image atomics (#5537) 2025-01-15 08:05:13 -05:00
sagudev
6c10e0be73 Add changelog
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-01-15 11:14:17 +01:00
sagudev
ea5d3b953f Add test
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-01-15 11:14:17 +01:00
sagudev
a65216cabe [naga] wgsl automatic conversion for override initializers
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-01-15 11:14:17 +01:00
sagudev
4576e4d0d2 Refactor init and type handling into separate function from var
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-01-15 11:14:17 +01:00
Vecvec
21de7f7773
Support DXR in wgpu-hal & naga. (#6777)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-14 21:28:37 -05:00
Connor Fitzgerald
2cfea40acc
Fix bind group initialization in benchmarks (#6916) 2025-01-14 23:02:05 +00:00
Jim Blandy
90a97a1ed9
Add CHANGELOG.md entries for jimblandy's PRs. (#6918) 2025-01-14 22:45:03 +00:00
Vecvec
0b2c9e4f4b
[Ray-tracing] Change index offset to first index (#6873)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-14 16:56:24 -05:00
Jim Blandy
bd3e7b676e
[naga] Consolidate entry point tracing code. (#6917) 2025-01-14 21:12:52 +00:00
Connor Fitzgerald
c71d67010f
Fix Features when Depending on wgpu (#6915) 2025-01-14 18:19:43 +00:00
Jim Blandy
aa7bec65b9
[naga] Remove vestigial false. (#6909) 2025-01-13 23:02:47 +00:00
Erich Gubler
1963eb7c3f
diag(wgsl-in): use backticks for code-like text in WGSL FE errors (#6908) 2025-01-13 22:13:40 +00:00
Erich Gubler
cc741735df
fix(wgsl-in): print debug repr. of unexpected tokens (#6907) 2025-01-13 16:43:41 -05:00
teoxoy
f62090ed71 use StatelessTracker for acceleration structures 2025-01-13 20:52:55 +01:00
teoxoy
f17f10dcdd remove Tlas/Blas destroy methods
`Tlas.destroy` didn't check if the `Tlas` is used in a bind group of an active submission. The only reason we need the `destroy` methods for textures and buffers is because they allow users to eagerly release memory in browser implementations. I think we can remove the destroy methods on the acceleration structures for now as they complicate the picture without any gain. If they will be needed for Firefox we can add them back.
2025-01-13 20:52:55 +01:00
teoxoy
e066a23948 remove unused id 2025-01-13 20:52:55 +01:00
teoxoy
362e440552 add temp_resources to CommandBufferMutable, BakedCommands & EncoderInFlight, remove it from ActiveSubmission
Use `CommandBufferMutable.temp_resources` to store the ray tracing related staging buffers and scratch buffers. These shouldn't have been stored in `PendingWrites.temp_resources` because they can get destroyed early (before the command buffer that uses them has been submitted) if any other command buffer gets submitted first.
2025-01-13 20:52:55 +01:00
teoxoy
43e0ebde9f [wgpu-core] ray tracing: remove acceleration structures from pending writes
The acceleration structures are already being kept alive by the tracker in the command encoder.
2025-01-13 20:52:55 +01:00
teoxoy
fb9f91a668 [wgpu-core] ray tracing: use error handling helpers 2025-01-13 20:52:55 +01:00
Teodor Tanasoaia
214396a807
[spv] output the right capability for subgroupBroadcast (#6904) 2025-01-13 14:29:04 -05:00
Connor Fitzgerald
f6dd3a4ff2
Turn off Merge Queue (#6901) 2025-01-13 16:51:24 +00:00
atlv
18471d8e78
Image atomics support (#6706)
* Image atomics support

* Address feedback

* fix merge

* Fixes

* Add a couple tests

* Update wgpu-types/src/lib.rs

Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>

* feedback

* feedback

* glsl

* glsl fix

* fix glsl

* fix fix

* fix fix fic

* fix?

* fix

---------

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
2025-01-13 15:37:12 +00:00
dependabot[bot]
a5704d9a1c
chore(deps): bump the patch-updates group with 14 updates (#6899)
* chore(deps): bump the patch-updates group with 14 updates

Bumps the patch-updates group with 14 updates:

| Package | From | To |
| --- | --- | --- |
| [bitflags](https://github.com/bitflags/bitflags) | `2.6.0` | `2.7.0` |
| [futures-lite](https://github.com/smol-rs/futures-lite) | `2.5.0` | `2.6.0` |
| [thiserror](https://github.com/dtolnay/thiserror) | `2.0.10` | `2.0.11` |
| [glutin_wgl_sys](https://github.com/rust-windowing/glutin) | `0.6.0` | `0.6.1` |
| [petgraph](https://github.com/petgraph/petgraph) | `0.6.5` | `0.7.1` |
| [syn](https://github.com/dtolnay/syn) | `2.0.95` | `2.0.96` |
| [cc](https://github.com/rust-lang/cc-rs) | `1.2.7` | `1.2.9` |
| [clap](https://github.com/clap-rs/clap) | `4.5.24` | `4.5.26` |
| [clap_builder](https://github.com/clap-rs/clap) | `4.5.24` | `4.5.26` |
| [const_panic](https://github.com/rodrimati1992/const_panic) | `0.2.11` | `0.2.12` |
| [prettyplease](https://github.com/dtolnay/prettyplease) | `0.2.27` | `0.2.29` |
| [proc-macro2](https://github.com/dtolnay/proc-macro2) | `1.0.92` | `1.0.93` |
| [uuid](https://github.com/uuid-rs/uuid) | `1.11.0` | `1.11.1` |
| [winnow](https://github.com/winnow-rs/winnow) | `0.6.22` | `0.6.24` |


Updates `bitflags` from 2.6.0 to 2.7.0
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitflags/bitflags/compare/2.6.0...2.7.0)

Updates `futures-lite` from 2.5.0 to 2.6.0
- [Release notes](https://github.com/smol-rs/futures-lite/releases)
- [Changelog](https://github.com/smol-rs/futures-lite/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/futures-lite/compare/v2.5.0...v2.6.0)

Updates `thiserror` from 2.0.10 to 2.0.11
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/2.0.10...2.0.11)

Updates `glutin_wgl_sys` from 0.6.0 to 0.6.1
- [Release notes](https://github.com/rust-windowing/glutin/releases)
- [Changelog](https://github.com/rust-windowing/glutin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-windowing/glutin/commits)

Updates `petgraph` from 0.6.5 to 0.7.1
- [Changelog](https://github.com/petgraph/petgraph/blob/master/RELEASES.rst)
- [Commits](https://github.com/petgraph/petgraph/compare/petgraph@v0.6.5...petgraph@v0.7.1)

Updates `syn` from 2.0.95 to 2.0.96
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.95...2.0.96)

Updates `cc` from 1.2.7 to 1.2.9
- [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.7...cc-v1.2.9)

Updates `clap` from 4.5.24 to 4.5.26
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.24...clap_complete-v4.5.26)

Updates `clap_builder` from 4.5.24 to 4.5.26
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.5.24...v4.5.26)

Updates `const_panic` from 0.2.11 to 0.2.12
- [Release notes](https://github.com/rodrimati1992/const_panic/releases)
- [Changelog](https://github.com/rodrimati1992/const_panic/blob/main/Changelog.md)
- [Commits](https://github.com/rodrimati1992/const_panic/commits/0.2.12)

Updates `prettyplease` from 0.2.27 to 0.2.29
- [Release notes](https://github.com/dtolnay/prettyplease/releases)
- [Commits](https://github.com/dtolnay/prettyplease/compare/0.2.27...0.2.29)

Updates `proc-macro2` from 1.0.92 to 1.0.93
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.92...1.0.93)

Updates `uuid` from 1.11.0 to 1.11.1
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/1.11.0...1.11.1)

Updates `winnow` from 0.6.22 to 0.6.24
- [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md)
- [Commits](https://github.com/winnow-rs/winnow/compare/v0.6.22...v0.6.24)

---
updated-dependencies:
- dependency-name: bitflags
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: patch-updates
- dependency-name: futures-lite
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: patch-updates
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: glutin_wgl_sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: petgraph
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: patch-updates
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: cc
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: clap
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: clap_builder
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: const_panic
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: prettyplease
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: proc-macro2
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: uuid
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: winnow
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update naga/Cargo.toml

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-13 03:15:57 +00:00
Zachary Harrold
05e62f96f9
Add no_std support to wgpu-types (#6892)
* Initial Commit

* Remove now-redundant `format` import

* Update CHANGELOG.md

* Appropriately feature-gate `texture_format_serialize` test

* Remove `alloc` feature

Also fixed some documentation links and a Wasm `std` import

* Revert change to `Serialize` for `TextureFormat`

* Combine use statements

* Switch from `PathBuf` to `String`

* Consider environmental flags as unset on `no_std`

* Fix missing `format!`

* Add new CI tasks for `no_std` testing

* Comment out known failing CI matrix option

* Update all usage of `Dx12Compiler::DynamicDxc`

* Added comments to CI

* Update .github/workflows/ci.yml

* Update .github/workflows/ci.yml

* Update .github/workflows/ci.yml

* CI Touchups

---------

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-12 05:03:47 +00:00
Eric Szentivanyi
4efc992d6d
Add raw_handle method for metal texture (#6894)
* Add `raw_handle` method for metal texture

* Add raw_handle method for metal texture (#6894)
2025-01-11 02:45:09 +00:00
Connor Fitzgerald
44b23c396d
Bump Nightly Version (#6896) 2025-01-10 21:42:42 -05:00
AbdullahElsheshtawy
55391f716d
Added Texture Blitting Utility (#6852)
* Added TextureBlitter Utility

* Fixed Clippy and made TextureBlitter Public

* Written Documentation

* change cull_mode

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

* syntax error

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

* 1 formatting space in shader

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

* Applied suggestions

* fix test

* Fixed typos

* Fixed the tests

* Fixed the shader after trying it manually and looking at the output.

* Added `BlendState` customization parameter.

* Apply suggestions from code review

Documentation!

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

* Made it Load instead of Clear(Black)

* Added `TextureBlitterBuilder`

* Added feature wgsl feature flag for `pub use texture_blitter...;`

* Re-add file

---------

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-10 22:16:01 +00:00
Erich Gubler
d9cc72785b
Use more Rust features allowed under REPO_MSRV (#6887)
* chore: remove `std::mem::*` imports now unnecessary with `REPO_MSRV`

`std::mem::{size,align}_of{,_val}` was added to `std::prelude` in Rust
1.80; see
[`rust`#123168](https://github.com/rust-lang/rust/pull/123168/).

* refactor(benches): s/once_cell::Lazy/std::sync::LazyLock

Weaken our dependence on the `once_cell` crate by using functionality
from `std` instead that was upstreamed from `once_cell`, this time with
what's available in Rust 1.80+.

It's not yet possible to eliminate this dependency entirely, but do what
we can with `REPO_MSRV` for now.

* chore: remove unnecessarily `allow`'d lint rules under `REPO_MSRV`

* chore: migrate easy `allow`s to `expect` under `REPO_MSRV`

Remove or `expect` clear-cut `allow` statements that were easy for me to
figure out.

* chore: `warn` on `clippy::allow_attributes` under `REPO_MSRV`
2025-01-10 22:06:26 +00:00
Connor Fitzgerald
450ac2d05d
Fix Double Push (#6890) 2025-01-10 19:47:25 +00:00
Connor Fitzgerald
2088645b69
Fix Double Push (#6889) 2025-01-10 18:16:59 +00:00
Connor Fitzgerald
b0f1fa66ef
Add VisionOS Support (#6888)
* Add visionos support

* Use `target_vendor = "apple"`

* Fixes

* Build VisionOS

* Gah

* Bleh

* Typos

---------

Co-authored-by: Guus Waals <_@guusw.nl>
2025-01-10 17:33:58 +00:00
the letter L
1aabf22e7a
fix cts_runner (#6840)
* fix: unbreak compute_pass execution and state

* fix: cts_runner js_runtime needs Permissions struct

* fix: ColorWrites bitflags serde

---------

Co-authored-by: turbocrime <turbocrime@users.noreply.github.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-10 16:46:10 +00:00
Connor Fitzgerald
c655d5290b
Don't Run CI On Trunk (#6886) 2025-01-10 09:47:13 +00:00
Samson
dc9b2eb718
Add Instance::wgsl_language_features (#6814)
* docs(naga): clarify desc. for `LanguageExtension`

* feat(naga): expose `{,Implemented,Unimplemented}LanguageExtension`

* feat(naga): expose `ImplementedLanguageExtension` as `WgslLanguageExtension`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-Authored-By: Erich Gubler <erichdongubler@gmail.com>

* feat: add `Instance::wgsl_language_features`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-Authored-By: Erich Gubler <erichdongubler@gmail.com>

* refactor: reimpl. `ImplementedLanguageExtension::all` w/ `strum::VariantArray`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2025-01-10 04:02:39 +00:00
Connor Fitzgerald
98f1c728ed
Turn #6827 Into Failing Regression Test (#6883)
* Turn 6827 Into Failing Regression Test

* Update tests/tests/regression/issue_6827.rs

Co-authored-by: Kevin Reid <kpreid@switchb.org>

* Format

* Fix Paravirtual Device

* DX12 Failure

* Validation Err

* Panick

---------

Co-authored-by: Kevin Reid <kpreid@switchb.org>
2025-01-09 16:53:29 +00:00
Asher Jingkong Chen
198762e5cc
feat: Add 32-bit floating-point atomics (SHADER_FLOAT32_ATOMIC) (#6234)
* feat: Add 32-bit floating-point atomics

* Current supported platforms: Metal
* Platforms to support in the future: Vulkan

Related issues or PRs:

* gfx-rs/wgpu#1020

* Add changelog

* Edit changelog

* feat: Add 32-bit float atomics support for Vulkan (SPIR-V shaders)

* atomicSub for f32 in the previous commits is removed.

* Update test

* chore: doc type link

* refactor: Revise float atomics on msl and spv

* Make branches tidy
* Also revise old codes
* Ensure the implementations are supported by Metal and Vulkan backends

* refactor: Renaming flt32 atomics to float32 atomics

* chore: Add link to Vulkan feature

* fix: cargo fmt

* chore: hack comment

* Revert changelog

* Fix: Cargo advisory

* Update wgpu-hal/src/metal/adapter.rs

Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>

* Update naga/src/lib.rs

Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>

* Adjust feature flag position

---------

Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
2025-01-09 16:03:47 +00:00
Jim Blandy
6e2394b95e
[naga] Validate override array sizes. (#6882)
When an array type `A`'s size is `PendingArraySize::Override(h)`,
verify that:

- `h` is a valid override handle,

- the override's type precedes `A` in the type arena, and

- the override's expression does not participate in a type/global
  expression cycle.

Fixes #6880.
2025-01-09 12:13:45 +00:00