Commit Graph

7498 Commits

Author SHA1 Message Date
Erich Gubler
14a7698d16
v0.20.2 release for wgpu et al., v0.21.1 release for wgpu-{core,hal} (#5850)
Co-authored-by: Nicolas Silva <nical@fastmail.com>
2024-06-24 18:00:23 -04:00
TÖRÖK Attila
32d21c8e4f
Backport Do not feed &"" to D3DCompile (#5812) to 0.20 (#5831)
A recent change by rustc, now in 1.79-stable, makes empty str constants
point to the same location: 0x01. This is an optimization of sorts, not
stable behavior. Code must not rely on constants having stable addresses
nor should it pass &"" to APIs expecting CStrs or NULL addresses.
D3DCompile will segfault if you give it such a pointer, or worse:
read random garbage addresses!

Pass the NULL pointer to D3DCompile if wgpu lacks a decent CString.

refs:
- https://learn.microsoft.com/en-us/windows/win32/api/d3dcompiler/nf-d3dcompiler-d3dcompile

Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
Co-authored-by: Jan Hohenheim <jan@hohenheim.ch>
Co-authored-by: Brezak <bezak.adam@proton.me>
2024-06-18 15:46:36 -04:00
Connor Fitzgerald
098c56ff7a
CI issues 2024-06-12 21:30:41 -04:00
Connor Fitzgerald
812727d888
Changelog and versions 2024-06-12 20:47:11 -04:00
Elabajaba
c8b88767a4
Deduplicate submitted surfaces to avoid a vulkan deadlock/crash (#5799) 2024-06-12 18:21:43 -04:00
Connor Fitzgerald
6f1507ff7c
[hal/vk] Rework Submission and Surface Synchronization (#5681)
Fix two major synchronization issues in `wgpu_val::vulkan`:

- Properly order queue command buffer submissions. Due to Mesa bugs, two semaphores are required even though the Vulkan spec says that only one should be necessary.

- Properly manage surface texture acquisition and presentation:

    - Acquiring a surface texture can return while the presentation engine is still displaying the texture. Applications must wait for a semaphore to be signaled before using the acquired texture.

    - Presenting a surface texture requires a semaphore to ensure that drawing is complete before presentation occurs.

Co-authored-by: Jim Blandy <jimb@red-bean.com>
2024-06-12 18:13:00 -04:00
Vladas Zakrevskis
687180a678
Fix missing family check flag (#5744)
* fix: missed family check flag

* fix: fmt and changelog
2024-05-26 11:51:00 +02:00
Connor Fitzgerald
d1701a1e46 Fix Failure Case for MacOS 14.3 2024-05-18 12:27:31 -04:00
Andreas Reich
2c8a597641 minor changelog improvement 2024-05-18 12:27:31 -04:00
Connor Fitzgerald
9331e1dfb6 Remove #[doc(inline)] to Prevent Doc Spam 2024-05-18 12:27:31 -04:00
Valaphee The Meerkat
ae7842e539 Fix OpenGL non-srgb on Linux (#5642) 2024-05-18 12:27:31 -04:00
Samson
5f357506dd Cast ptr to Device not Surface (#5640) 2024-05-18 12:27:31 -04:00
Connor Fitzgerald
c81ac937e1 Fix Subgroup Ops on VK 1.2 Device (#5624) 2024-05-18 12:27:31 -04:00
Xiaopeng Li
093204169b Clean up weak references to texture views and bind groups (#5595)
* Clean up weak references to texture views

* add change to CHANGELOG.md

* drop texture view before clean up

* cleanup weak ref to bind groups

* update changelog

* Trim weak backlinks in their holders' triage functions.

---------

Co-authored-by: Jim Blandy <jimb@red-bean.com>
2024-05-18 12:27:31 -04:00
Connor Fitzgerald
4521502da6
Release v0.20.0 (#5619) 2024-04-28 18:06:35 -04:00
dependabot[bot]
05cfdececc
build(deps): bump the patch-updates group with 5 updates (#5605)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2024-04-28 17:44:12 -04:00
Erich Gubler
e8e33ede11
refactor(naga): remove extraneous leading path qualifiers (#5612)
Implemented by `cargo fix -p naga --lib`.
2024-04-28 16:33:13 +02:00
Jim Blandy
1ea96391ea
[hal] Document Api::Fence, its users, and its Vulkan impl. (#5618)
Also, rename `wgpu_hal::vulkan::Fence::check_active` argument to
`last_completed`, and explain better its rationale.
2024-04-28 05:46:06 +00:00
Jim Blandy
4af2e7b8fb [hal] Document Queue::submit ordering guarantees a bit. 2024-04-27 22:14:23 -07:00
Jim Blandy
a2cd2b92b3
[hal] Fix cargo doc --document-private-items. Check in CI. (#5617) 2024-04-27 20:21:29 +00:00
vero
9eb1b71d33
Add some more changelog entries (#5611)
* Add some more changelog entries

* Address feedback
2024-04-26 15:06:34 +02:00
vero
739905e73c
Extract a naga pub create_validator function for use in Bevy (#5606) 2024-04-26 10:19:45 +02:00
Jim Blandy
d4f30638b7 [core] Fix caller location tracking in lock::ranked.
Properly track the location of callers of `Mutex::lock`,
`RwLock::read`, and `RwLock::write`, for use in panic messages.
2024-04-25 12:46:05 -07:00
teoxoy
55c9d69ba0 [naga] fix the way we adjust constant initializers when processing overrides
This fixes 2 issues:
- we used to index `adjusted_global_expressions` with the handle index of the constant instead of its initializer
- we used to adjust the initializer multiple times if the arena contained multiple `Expression::Constant`s pointing to the same constant
2024-04-25 11:04:09 -07:00
Samson
5735f85720
CreateBindGroup validation error on device mismatch (#5596)
* Fix cts_runner command invocation in readme

* Remove assertDeviceMatch from deno_webgpu in createBindGroup

This should be done as verification in wgpu-core.

* Add device mismatched check to create_buffer_binding

* Extract common logic to create_sampler_binding

* Move common logic to create_texture_binding and add device mismatch check
2024-04-25 12:17:00 +02:00
vero
18ceb5183c
[spv-out] Move request_type_capabilities outside of LocalType lookup 2024-04-25 11:17:23 +02:00
Jim Blandy
a364e566cd [core] Use lock::RwLock in RenderBundleScope.
This requires bumping the `LockRankSet` bitset from `u32` to `u64`.
2024-04-25 01:28:21 -04:00
Jim Blandy
927b7e96fe [core] Use lock::RwLock in Registry. 2024-04-25 01:28:21 -04:00
Jim Blandy
36e0a135f5 [core] Use lock::RwLock in Buffer and Texture. 2024-04-25 01:28:21 -04:00
Jim Blandy
d089b86c59 [core] Include SnatchLock in lock rankings. 2024-04-25 01:28:21 -04:00
Jim Blandy
43f2315753 [core] Add checked RwLock. 2024-04-25 01:28:21 -04:00
Jim Blandy
7d9a8beff3 [core] Abstract out checking code in lock::ranked.
Introduce two new private functions, `acquire` and `release`, to the
`lock::ranked` module, to perform validation for acquiring and
releasing locks. Change `Mutex::lock` and `MutexGuard::drop` to use
those functions, rather than writing out their contents.
2024-04-25 01:28:21 -04:00
Jim Blandy
d719373989 [core] Remove unnecessary #[inline] attributes in lock module. 2024-04-25 01:28:21 -04:00
Jim Blandy
3c21a98697 [core] Remove semicolon from lock rank macro syntax.
In `define_lock_ranks!` macro invocations, don't require a semicolon
after each rank's "followed by" list.
2024-04-25 01:28:21 -04:00
Imbris
ae758be2ec
Reword / reclassify a few changelog entries. (#5607) 2024-04-25 05:10:32 +00:00
vero
99fc6a11ad
Fix inconsistency in Limits defaults and clean up (#5601) 2024-04-25 00:30:20 -04:00
vero
34aab34c00
Fix int64 metal detection (#5604) 2024-04-25 03:13:26 +00:00
vero
671a2a8227
Update my username in the changelog (#5602) 2024-04-24 22:30:44 -04:00
Andreas Reich
d00a69615b
Prepare changelog for 0.20 (#5599) 2024-04-24 20:21:54 -04:00
Jim Blandy
253e65c9a4 [hal doc] Describe wgpu-hal's validation principles. 2024-04-24 14:43:12 -07:00
Jim Blandy
259b473964 [hal doc] Describe wgpu-hal's main traits in the top-level docs. 2024-04-24 14:43:12 -07:00
Jim Blandy
5bb9724636 [hal doc] Consistently use wgpu-hal for the crate name. 2024-04-24 14:43:12 -07:00
Imbris
82fa580152
[hlsl-out] Fix accesses on zero value expressions (#5587) 2024-04-24 10:40:08 +02:00
Andreas Reich
edf1a86148
Separate out ComputeCommand id->arc resolve (a step towards no lifetimes on wgpu::ComputePass) (#5432)
* move out compute command to separate module

* introduce ArcComputeCommand

* stateless tracker now returns reference to arc upon insertion

* add insert_merge_single to buffer tracker

* compute pass execution now works internally with an ArcComputeCommand

* compute pass execution now translates Command to ArcCommand ahead of time

* don't clone commands in compute pass execution

* remove doc hiding

* use option insert

* clippy fix

* fix private doc issue

* remove unnecessary copied over doc hide
2024-04-23 07:01:29 +00:00
Jim Blandy
b3c5a6fb84 [core] Enforce a deadlock-free locking order for Mutexes.
If `debug_assertions` or the `"validate-locks"` feature are enabled,
change `wgpu-core` to use a wrapper around `parking_lot::Mutex` that
checks for potential deadlocks.

At the moment, `wgpu-core` does contain deadlocks, so the ranking in
the `lock::rank` module is incomplete, in the interests of keeping it
acyclic. #5572 tracks the work needed to complete the ranking.
2024-04-22 18:49:03 -07:00
Luna
7840e75bf7
Add check to ensure vulkan::CommandEncoder::discard_encoding is not called multiple times in a row (#5557)
Document that `wgpu_hal::CommandEncoder::discard_encoding` must not be called multiple times.

Assert in `wgpu_hal::vulkan::CommandEncoder::discard_encoding` that encoding is actually in progress.

Fixes #5255.
2024-04-22 19:39:08 +00:00
dependabot[bot]
0d9e11d465
build(deps): bump the patch-updates group across 1 directory with 7 updates (#5584)
Bumps the patch-updates group with 6 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [raw-window-handle](https://github.com/rust-windowing/raw-window-handle) | `0.6.0` | `0.6.1` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.58` | `1.0.59` |
| [cc](https://github.com/rust-lang/cc-rs) | `1.0.94` | `1.0.95` |
| [jobserver](https://github.com/rust-lang/jobserver-rs) | `0.1.30` | `0.1.31` |
| [rustix](https://github.com/bytecodealliance/rustix) | `0.38.32` | `0.38.33` |
| [signal-hook-registry](https://github.com/vorner/signal-hook) | `1.4.1` | `1.4.2` |



Updates `raw-window-handle` from 0.6.0 to 0.6.1
- [Release notes](https://github.com/rust-windowing/raw-window-handle/releases)
- [Changelog](https://github.com/rust-windowing/raw-window-handle/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-windowing/raw-window-handle/compare/v0.6.0...v0.6.1)

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

Updates `cc` from 1.0.94 to 1.0.95
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Commits](https://github.com/rust-lang/cc-rs/compare/1.0.94...1.0.95)

Updates `jobserver` from 0.1.30 to 0.1.31
- [Commits](https://github.com/rust-lang/jobserver-rs/commits)

Updates `rustix` from 0.38.32 to 0.38.33
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.32...v0.38.33)

Updates `signal-hook-registry` from 1.4.1 to 1.4.2
- [Changelog](https://github.com/vorner/signal-hook/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vorner/signal-hook/compare/registry-v1.4.1...registry-v1.4.2)

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

---
updated-dependencies:
- dependency-name: raw-window-handle
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: thiserror
  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: jobserver
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: rustix
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: signal-hook-registry
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: thiserror-impl
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 19:49:16 +02:00
teoxoy
c2e520c52c [naga] add Expression::Override to needs_pre_emit 2024-04-22 08:38:31 -07:00
dependabot[bot]
dd6ac1c804
build(deps): bump JamesIves/github-pages-deploy-action from 4.5.0 to 4.6.0 (#5580)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 10:22:21 -04:00
dependabot[bot]
c6f537c70b
build(deps): bump crate-ci/typos from 1.20.8 to 1.20.9 (#5579)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.20.8 to 1.20.9.
- [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.20.8...v1.20.9)

---
updated-dependencies:
- dependency-name: crate-ci/typos
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 14:55:58 +02:00