Commit Graph

7048 Commits

Author SHA1 Message Date
dependabot[bot]
d7296ac30b Bump web-time from 0.2.3 to 0.2.4 (#4929)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-25 03:41:32 +00:00
dependabot[bot]
085141149b Bump winit from 0.29.5 to 0.29.6 (#4930)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-24 22:28:37 -05:00
Jim Blandy
9afd54ea24 [naga xtask] Use naga-cli's --bulk-validate option.
Use `naga --bulk-validate` for `cargo xtask validate wgsl`, reducing
runtime from 12s to 0.8s.
2023-12-24 12:03:28 -08:00
Jim Blandy
9013e226c3 [naga-cli] Add --bulk-validate option. 2023-12-24 12:03:28 -08:00
Jim Blandy
79a6a4b0d2 [naga-cli] Abstract out parsing of input file. 2023-12-24 12:03:28 -08:00
Erich Gubler
e1baa5a56e docs: inline document-features usage, remove dep.
Re-implements https://github.com/gfx-rs/wgpu/pull/4886 (CC @Wumpf)
without the `document-features` crate, which has issues integrating into
Firefox builds after being `cargo vendor`ed into its repository. This
issue is being tracked against
https://github.com/slint-ui/document-features/issues/20. Once resolved,
I expect that we will want to revert this PR in its entirety, since
`document-features` is still a good addition to `wgpu`'s documentation
story.

Internally, consensus has already been achieved for this change.
Firefox's ability to build unfortunately take priority over this
particular convenience. Hopefully, we won't have to compromise shortly!

I tested this by ensuring that the HTML output of our existing
`document_features::document_features!(…)` usage was exactly the same.
There should be exactly zero regressions in the current state of
documentation for users. For maintainers, I have added a disclaimer that
one needs to keep changes in sync. with the relevant `Cargo.toml`
manifests.
2023-12-22 14:31:12 -05:00
dependabot[bot]
c97b351b83 Bump winit from 0.29.4 to 0.29.5 (#4922)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-21 23:19:32 -05:00
Andrew Farkas
2993650ede Fix typo "layout pipeline layout" -> "pipeline layout" (#4921) 2023-12-22 01:02:41 +00:00
Connor Fitzgerald
79e5169255 Add BGL Deduplication Index Test (#4914) 2023-12-21 12:16:20 -05:00
Connor Fitzgerald
87ecc089dd Remove id32 feature 2023-12-20 21:39:24 -08:00
dependabot[bot]
d9784aca8e Bump anyhow from 1.0.75 to 1.0.76 (#4910)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-21 03:00:44 +00:00
dependabot[bot]
3b5951c696 Bump profiling from 1.0.12 to 1.0.13 (#4909)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-21 03:00:07 +00:00
dependabot[bot]
f3bb4a5cb5 Bump syn from 2.0.41 to 2.0.42 (#4908)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-20 21:50:11 -05:00
Connor Fitzgerald
090f2f757c Use nightly for docs (#4906) 2023-12-20 18:59:22 -05:00
Brad Werth
9eea31a4ae Eagerly release GPU resources when we lose the device. (#4851)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-12-20 22:43:43 +00:00
Nicolas Silva
85b91c0408 Buffer snatching (#4896)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-12-20 16:42:42 -05:00
Nicolas Silva
164e478fcb Simplify some code around buffer unmapping (#4892) 2023-12-20 15:21:32 -05:00
Meo
4de4ddcc3c fix: docs (#4901) 2023-12-20 20:15:35 +00:00
Nicolas Silva
0524c88c03 Check that raw buffers and raw bind groups are valid (#4895) 2023-12-20 15:13:20 -05:00
dependabot[bot]
0e3500644f Bump tokio from 1.35.0 to 1.35.1 (#4903)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.35.0 to 1.35.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.35.0...tokio-1.35.1)

---
updated-dependencies:
- dependency-name: tokio
  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>
2023-12-20 19:24:51 +00:00
sotaroikeda
1d6c7a0263 Support Device fence sharing with dx12 on Windows (#4900)
Co-authored-by: Sotaro Ikeda <you@example.com>
2023-12-20 13:33:47 -05:00
Brad Werth
56d9d32a07 [wgpu-core] Ensure that DeviceLostCallback is always called exactly once
* Ensure device lost closure is called exactly once before being dropped.

This requires a change to the Rust callback signature, which is now Fn
instead of FnOnce. When the Rust callback or the C closure are dropped,
they will panic if they haven't been called. `device_drop` is changed
to call the closure with a message of "Device dropped." A test is added.
2023-12-19 23:16:10 +00:00
Nicolas Silva
aade481bdf Remove some locks in BindGroup (#4894)
* Remove some locks in BindGroup

These are only written to clear the vectors when triaging bindgroups for destruction, which is not necessary. We can let the reference counts drop when the bind group is dropped.

* Make the mem_leak test pass again
2023-12-19 10:29:32 +01:00
Nicolas Silva
a1b183f736 Avoid allocating memory every time we might log a label (#4893)
We allocate a String every time we want to get a label for logging. The string is also allocated when logging is disabled. Either way, the allocation is unnecessary. This commit replaces the String with a dyn Debug reference which does not need any allocation.
2023-12-18 13:08:18 +01:00
Nicolas Silva
625165e60e Make the naga version in trunk as high as the latest published one. (#4891) 2023-12-18 04:05:16 -05:00
Nicolas Silva
192a2fe16c Simplify ResourceMaps (#4880)
* Remove the abstractions in resource maps

ResourceMaps had a rather convoluted system for erasing types that isn't needed anywhere except in one place in the triage_resource function. Everywhere else we are always dealing with specific types so using a member of the resource maps is simpler than going through an abstraction. More importantly there was a constraint that all contents of the resource maps implement the Resource trait which got in the way of some of the ongoing buffer snatching changes.

This commit simplifies this by removing the abstraction. Each resource type has its hash map directly in ResourceMaps and it is easier to have different requirements and behaviors depending on the type of the each resource.
2023-12-18 08:27:58 +00:00
dependabot[bot]
790c40fd44 Bump thiserror from 1.0.50 to 1.0.51 (#4890)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-17 22:10:40 -05:00
daxpedda
bcdc240a9a WebGL: add support for more RawWindowHandle variants (#4888) 2023-12-17 20:47:38 -05:00
Mikko Lehtonen
159ac9e373 validation: More detailed on incompatible BGL (#4826) 2023-12-17 18:22:39 -05:00
Andreas Reich
ba56dd2901 Document wgpu & wgpu-core features (#4886) 2023-12-17 22:10:38 +00:00
Nicolas Silva
10dd5844ac Allow clippy::pattern_type_mismatch (#4887) 2023-12-17 15:00:02 -05:00
daxpedda
2053358d89 Add wgpu crate features for backends (#4815)
* Introduce `dx12` and `metal` crate features to `wgpu`

* Implement dummy `Context` to allow compilation with `--no-default-features`

* Address review

* Remove `dummy::Context` in favor of `hal::api::Empty`

* Add changelog entry

* Panic early in `Instance::new()` if no backend is enabled

Co-Authored-By: Andreas Reich <1220815+Wumpf@users.noreply.github.com>

---------

Co-authored-by: Andreas Reich <1220815+Wumpf@users.noreply.github.com>
2023-12-16 10:39:53 +01:00
Nicolas Silva
855b06977f Refactor create_buffer so that we can snatch the raw buffer in the error path. (#4878)
The general idea is to register postpone reigistering the buffer until towards the end of the function so that our unique reference to it lets us easily snatch the raw buffer if an error happens.
2023-12-15 10:08:03 +01:00
dependabot[bot]
96dacbbb4d Bump zerocopy from 0.7.26 to 0.7.31 (#4882)
Bumps [zerocopy](https://github.com/google/zerocopy) from 0.7.26 to 0.7.31.
- [Release notes](https://github.com/google/zerocopy/releases)
- [Changelog](https://github.com/google/zerocopy/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google/zerocopy/compare/v0.7.26...v0.7.31)

---
updated-dependencies:
- dependency-name: zerocopy
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-15 08:42:28 +01:00
Nicolas Silva
c5e6122b65 Reintroduce buffer snatching Part 1 (#4867)
Introduce snatch guards
2023-12-14 13:14:49 +01:00
Jim Blandy
d9d051b7a5 [naga wgsl] Let unary operators accept and produce abstract types.
Fixes #4445.
Fixes #4492.
Fixes #4435.
2023-12-14 10:54:46 +01:00
Jim Blandy
c4b43875e5 [naga wgsl-in] Support abstract operands to binary operators. 2023-12-13 08:42:26 -08:00
Jim Blandy
f2828ace38 [naga wgsl-in] Separate out convert_to_leaf_scalar.
Abstract out the body of `convert_slice_to_common_leaf_scalar`'s main
loop into its own function. Code motion only, no intended change of
behavior.
2023-12-13 08:42:26 -08:00
Jim Blandy
0df496062e [naga wgsl-in] Rename convert_slice_to_common_leaf_scalar.
This is a mouthful, but it's going to align better with functions to
be introduced in later commits.
2023-12-13 08:42:26 -08:00
Jim Blandy
f4161189fa [naga wgsl-in] Relax arg type for automatic_conversion_consensus. 2023-12-13 08:42:26 -08:00
Jim Blandy
84c74adec2 [naga wgsl-in] Relocate automatic_conversion_consensus.
Move `naga::front::wgsl::lower::construction::automatic_conversion_consensus`
into `conversion.rs`, and make it a method of `ExpressionContext`.
2023-12-13 08:42:26 -08:00
Jim Blandy
3ffd5a1e56 [naga wgsl-out] Include the f suffix on f32 literals.
Without the suffix, `Expression::Literal(Literal::F32)` expressions
get written without any suffix on the number, meaning that they get
re-parsed as `AbstractFloat` values. In theory, this should always be
fine, but since we don't actually support abstract types yet in all
the places we should, having them appear in the output causes
validation problems.

See also: #4863, which did the same for `i32` literals.
2023-12-13 13:42:05 +01:00
dependabot[bot]
4d1e316197 Bump syn from 2.0.40 to 2.0.41 (#4874)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-13 00:20:29 -05:00
dependabot[bot]
08fce4ae36 Bump ctor from 0.2.5 to 0.2.6 (#4873)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-13 00:20:12 -05:00
Xiaopeng Li
ecc301ea16 fix present mode for wgl (#4865) 2023-12-12 13:36:43 -05:00
Jim Blandy
6dc9ccab85 [naga wgsl-out] Include the i suffix on i32 literals. (#4863)
Without the suffix, `Expression::Literal(Literal::I32)` expressions
get written without any suffix on the decimal number, meaning that
they get re-parsed as AbstractInt values. In theory, this should
always be fine, but since we don't actually support abstract types yet
in all the places we should, having them appear in the output causes
validation problems.
2023-12-12 12:07:10 +00:00
Jim Blandy
4b6a2d1dfa [naga] Teach the constant evaluator vector/vector operators.
Allow constant evaluation of binary operators whose left and right
operands are both vectors.
2023-12-12 12:48:10 +01:00
Jim Blandy
0e41cfe4ca [naga] Change operators.wgsl to use values that matter.
Change `splat` to take run-time values as arguments, to prevent
constant evaluation from boiling everything away.
2023-12-12 12:48:10 +01:00
Jim Blandy
439bf3c1b4 [naga wgsl-in] Improve error message for failed concretization. 2023-12-12 12:48:10 +01:00
dependabot[bot]
d9bfab5bec Bump syn from 2.0.39 to 2.0.40 (#4864)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.39 to 2.0.40.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.39...2.0.40)

---
updated-dependencies:
- dependency-name: syn
  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>
2023-12-12 09:28:31 +01:00