Commit Graph

8102 Commits

Author SHA1 Message Date
teoxoy
ccd6d2ca48 remove BoundsCheckPolicies.image_store 2024-07-26 10:44:22 -07:00
Matthew Wong
339ecf37da
Fix error message in create_render_pass (#6041) 2024-07-26 16:59:41 +00:00
Bruce Mitchener
3166d37754
Use workspace dependencies more. (#6020) 2024-07-26 18:48:01 +02:00
teoxoy
1f4f675b1b [naga] add back PartialEq derives for some types 2024-07-26 09:37:52 -07:00
Andreas Reich
d3c38a4fd0
Fix AnyDevice drop implementation dropping the wrong thing (#6052) 2024-07-26 10:31:36 +02:00
teoxoy
03f6d24ea6 deduplicate derived BGLs 2024-07-25 18:15:29 +02:00
Marijn Suijten
2611d18b15 gles/wgl: Migrate from ancient/unmaintained winapi to windows-rs 2024-07-25 11:15:26 +02:00
Erich Gubler
591e1d2a08 refactor(naga)!: remove FunctionTracer::overrides 2024-07-24 13:42:04 -04:00
Erich Gubler
6b3e039250 refactor(naga)!: remove ExpressionTracer::overrides 2024-07-24 13:42:04 -04:00
Erich Gubler
54fb4ccf7d refactor(naga)!: remove Function::locals, migrate docs to ExpressionContext::locals 2024-07-24 13:42:04 -04:00
Erich Gubler
65b6e15f0f chore: satisfy clippy::unused_qualifications 2024-07-24 12:09:15 -04:00
Erich Gubler
723995d9a9 refactor: warn on and satisfy clippy::{ptr_as_ptr,ref_as_ptr} in wgpu-{core,hal,types}
…using `cargo +1.79.0 clippy --workspace --all-features --all-targets
--fix`, plus some manual changes to (1) catch some missed cases (not run
on all platforms?) and (2) `--fix` doesn't make things compile again. 😀
2024-07-24 12:09:15 -04:00
Bruce Mitchener
06649a39f3
Fix a clippy::doc_lazy_continuation lint (#6036) 2024-07-24 18:08:21 +02:00
Samson
2897fb58db
Error instead of panic in check bind (#6012)
Removed zipping of binding entries introduced in 4a19ac279c (to make sure binding numbers actually match) and add unknown error for fallback.
2024-07-24 17:50:18 +02:00
Bruce Mitchener
4f02057359 Convert some module doc comments
Some module doc comments were using `/*! ... */` syntax and had
leading ` *` prefixes on each line. This interferes with the
tracking of `clippy::doc_lazy_continuation`, so switch those over
to `//!` style comment blocks.

This leaves `/*! ... */` blocks alone which didn't prefix each
line.
2024-07-24 11:17:00 -04:00
Bruce Mitchener
ea81a24414 naga: Remove feature std for indexmap
This was added in https://github.com/gfx-rs/naga/pull/2062

This was needed before version 2, but not in version 2, so it
should be safe to remove now as it is enabled by default.
2024-07-24 16:55:57 +02:00
renshuncui
62333a573e
chore: fix some comments (#6033)
Signed-off-by: renshuncui <renshun@111.com>
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2024-07-24 16:48:51 +02:00
Erich Gubler
fa93676991 docs(CHANGELOG): add entry for const. eval of first{Leading,Trailing}Bit 2024-07-24 09:12:23 -04:00
Erich Gubler
a220fcfc57 feat(const_eval): impl. firstTrailingBit 2024-07-24 09:12:23 -04:00
Erich Gubler
2f7c87f7af refactor(naga): rename MathFunction::FindLsb to FirstTrailingBit 2024-07-24 09:12:23 -04:00
Erich Gubler
5b44baa8c8 feat(const_eval): impl. firstLeadingBit 2024-07-24 09:12:23 -04:00
Erich Gubler
c5fce7b433 refactor(naga): rename MathFunction::FindMsb to FirstLeadingBit 2024-07-24 09:12:23 -04:00
Erich Gubler
3650f90079 refactor(const_eval): derive PartialEq for testing in component-wise enums 2024-07-24 09:12:23 -04:00
Erich Gubler
380387e8e2 refactor(const_eval): derive Debug for component-wise enums 2024-07-24 09:12:23 -04:00
Nicolas Silva
86507f33cd Reduce the number of iterations in benchmarks to a small number when running on CI 2024-07-24 14:52:22 +02:00
Nicolas Silva
7446790354 Fix a few entry_point parameters 2024-07-24 14:31:23 +02:00
Erich Gubler
e216566e48 feat(shader)!: make ProgrammableStage::entry_point optional 2024-07-24 07:40:00 -04:00
dependabot[bot]
4af1991569
build(deps): bump crate-ci/typos from 1.23.2 to 1.23.3 (#6028)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.23.2 to 1.23.3.
- [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.23.2...v1.23.3)

---
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-07-24 09:19:51 +02:00
Erich Gubler
7b2e08fb94
refactor: satisfy clippy::missing_transmute_annotations (#6024)
* refactor(metal): satisfy `clippy::missing_transmute_annotations`

* refactor(gles): satisfy `clippy::missing_transmute_annotations`

* refactor(metal): `metal::Surface::view`: use `ptr::cast` instead of `as`
2024-07-24 08:56:45 +02:00
Andreas Reich
9b680e6997
Undo doing less bench iterations under cfg(test) (#6021) 2024-07-24 08:56:14 +02:00
Bruce Mitchener
0aca442d15
typos: More precise config, remove refs to "implace" (#6018)
The config can be made more precise so as to not accidentally
ignore some issues due to case (in-)sensitivity and searching for
substrings with `extend-words`.

Additionally, we can check the configuration directories as
well like `.github`.

The usage of `implace_it` went away some time ago, but not all
references were removed.
2024-07-24 08:55:10 +02:00
Imbris
6d7975eb3b [naga hlsl-out glsl-out] Work around backend loop/switch bugs.
Introduce a new module, `naga:🔙:continue_forward`, containing
shared code for rendering Naga `Continue` statements as backend
`break` statements and assignments to introduced `bool` locals.
See the module's documentation for details.

- [hlsl-out] Transform degenerate single body switches into `do-while`
  loops. Properly render `Continue` statements enclosed by
  `Switch` statements enclosed by `Loop` statements.

- [glsl-out] Transform degenerate single body switches into `do-while`
  loops.

Improve `naga xtask validate spv` error message.

Fixes #4485.
Fixes #4514.
2024-07-23 18:12:19 -07:00
Erich Gubler
667096491d style: remove trailing colons in Safety section names 2024-07-23 14:02:16 -07:00
Erich Gubler
b350ca432b style: use uppercase for SAFETY comments 2024-07-23 14:02:16 -07:00
Jim Blandy
ebb011fc6b [core] Use ManuallyDrop for wgpu_core::device::Queue::raw.
Change the field `wgpu_core::device::Queue::raw` from an
`Option<A::Queue>` to a `std::mem::ManuallyDrop<A::Queue>`. Replace
various `.as_ref().unwrap()` chains with calls to a new accessor
function `Queue::raw`.

An `Option` is misleading, as this field is always populated during
the lifetime of a `Queue`. Instead, we simply have a field whose value
needs to be moved in `<Queue as Drop>::drop`; `ManuallyDrop` is the
Rust idiom for this situation.
2024-07-23 14:02:16 -07:00
Nicolas Silva
34d492a647 Reexport InternalCounters, HalCounters and CoreCounters in wgpu 2024-07-23 16:23:31 +02:00
teoxoy
205f1e3ab6 [wgpu-core] fix length of copy in queue_write_texture #2
Follow-up to 6f16ea460a & 7e112ca4c0.
2024-07-22 12:25:07 +02:00
dependabot[bot]
101c996703
build(deps): bump the patch-updates group with 15 updates (#6008)
Bumps the patch-updates group with 15 updates:

| Package | From | To |
| --- | --- | --- |
| [bit-vec](https://github.com/contain-rs/bit-vec) | `0.7.0` | `0.8.0` |
| [libloading](https://github.com/nagisa/rust_libloading) | `0.8.4` | `0.8.5` |
| [tracy-client](https://github.com/nagisa/rust_tracy_client) | `0.17.0` | `0.17.1` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.62` | `1.0.63` |
| [bit-set](https://github.com/contain-rs/bit-set) | `0.6.0` | `0.8.0` |
| [glow](https://github.com/grovesNL/glow) | `0.13.1` | `0.14.0` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.38.0` | `1.38.1` |
| [syn](https://github.com/dtolnay/syn) | `2.0.71` | `2.0.72` |
| [arrayref](https://github.com/droundy/arrayref) | `0.3.7` | `0.3.8` |
| [cc](https://github.com/rust-lang/cc-rs) | `1.1.5` | `1.1.6` |
| [thiserror-impl](https://github.com/dtolnay/thiserror) | `1.0.62` | `1.0.63` |
| [thread-id](https://github.com/ruuda/thread-id) | `4.2.1` | `4.2.2` |
| [tracy-client-sys](https://github.com/nagisa/rust_tracy_client) | `0.22.2` | `0.23.0` |
| [wayland-backend](https://github.com/smithay/wayland-rs) | `0.3.5` | `0.3.6` |
| [xcursor](https://github.com/esposm03/xcursor-rs) | `0.3.5` | `0.3.6` |


Updates `bit-vec` from 0.7.0 to 0.8.0
- [Changelog](https://github.com/contain-rs/bit-vec/blob/master/RELEASES.md)
- [Commits](https://github.com/contain-rs/bit-vec/commits)

Updates `libloading` from 0.8.4 to 0.8.5
- [Commits](https://github.com/nagisa/rust_libloading/compare/0.8.4...0.8.5)

Updates `tracy-client` from 0.17.0 to 0.17.1
- [Commits](https://github.com/nagisa/rust_tracy_client/compare/tracy-client-v0.17.0...tracy-client-v0.17.1)

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

Updates `bit-set` from 0.6.0 to 0.8.0
- [Release notes](https://github.com/contain-rs/bit-set/releases)
- [Changelog](https://github.com/contain-rs/bit-set/blob/master/RELEASES.md)
- [Commits](https://github.com/contain-rs/bit-set/commits)

Updates `glow` from 0.13.1 to 0.14.0
- [Commits](https://github.com/grovesNL/glow/commits)

Updates `tokio` from 1.38.0 to 1.38.1
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.38.0...tokio-1.38.1)

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

Updates `arrayref` from 0.3.7 to 0.3.8
- [Commits](https://github.com/droundy/arrayref/commits)

Updates `cc` from 1.1.5 to 1.1.6
- [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.1.5...cc-v1.1.6)

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

Updates `thread-id` from 4.2.1 to 4.2.2
- [Changelog](https://github.com/ruuda/thread-id/blob/master/changelog.md)
- [Commits](https://github.com/ruuda/thread-id/compare/v4.2.1...v4.2.2)

Updates `tracy-client-sys` from 0.22.2 to 0.23.0
- [Commits](https://github.com/nagisa/rust_tracy_client/compare/tracy-client-sys-v0.22.2...tracy-client-sys-v0.23.0)

Updates `wayland-backend` from 0.3.5 to 0.3.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 `xcursor` from 0.3.5 to 0.3.6
- [Commits](https://github.com/esposm03/xcursor-rs/commits)

---
updated-dependencies:
- dependency-name: bit-vec
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: patch-updates
- dependency-name: libloading
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: tracy-client
  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: bit-set
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: patch-updates
- dependency-name: glow
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: patch-updates
- dependency-name: tokio
  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: arrayref
  dependency-type: indirect
  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: thiserror-impl
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: thread-id
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: tracy-client-sys
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: patch-updates
- dependency-name: wayland-backend
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: xcursor
  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-07-22 00:20:29 -04:00
Vladas Zakrevskis
5a0e2187f0
Print requested and supported usages on UnsupportedUsage error (#6007)
* Print requested and supported usages on UnsupportedUsage error

* fmt

* changelog
2024-07-21 21:12:28 -04:00
Andreas Reich
c0e7c1ef94 Bump core MSRV to 1.76 2024-07-20 15:55:28 -04:00
Connor Fitzgerald
164b7bd3e7
Split wgpu Crate into Modules (#5998)
* Split wgpu/lib.rs into Modules
* Use crate::* Imports
2024-07-20 08:58:56 +02:00
Bruce Mitchener
cf5798291f
Remove allow(unknown_lints) and clippy::if_then_panic (#6000) 2024-07-20 03:35:19 +00:00
Bruce Mitchener
c20946d02f wgpu-types: Use explicit feature for serde
This helps to prepare for the coming day when explicit features
will be required.
2024-07-19 15:07:02 -04:00
sagudev
fc87033b30 Make BufferAccessError (de)serializable
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-07-19 13:37:57 -04:00
sagudev
d03b7e239d Make RequestAdapterError (de)serializable
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-07-19 13:37:57 -04:00
sagudev
7a73c75e6a Make RequestDeviceError (de)serializable
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-07-19 13:37:57 -04:00
Kevin Reid
56d418f121 Partial revert "disable rustdoc in CI (#5839)"
This reverts most of the changes in a2fcd72606,
but the "document private features" step is still disabled since it
operates only on wgpu-core which is exactly the problem.
2024-07-19 11:37:00 -04:00
Kevin Reid
b5934e89f7 Disable wgpu-core documentation as a workaround for #4905.
This enables `cargo doc` to succeed in a reasonable amount of time,
as long as the reader isn't looking for documentation for `wgpu-core`
itself.
2024-07-19 11:37:00 -04:00
Brad Werth
6cd387412f Remove vertex_pulling_transfrom from PipelineCompilationOptions.
This option was only evaluated for Metal backends, and now it's required
there so the option is going away. It is still configurable for tests
via the PipelineOptions struct, deserialized from .ron files.

This also fixes some type problems with the unpack functions in
writer.rs. Metal << operator extends operand to int-sized, which then
has to be cast back down to the real size before as_type bit conversion.
The math for the snorm values is corrected, in some cases using the
metal unpack_snorm2x16_to_float function because we can't directly
cast a bit-shifted ushort value to half.
2024-07-19 17:13:45 +02:00
Nicolas Silva
bc7622f641 Expose GPU allocation reports in wgpu, wgpu-core and wgpu-hal 2024-07-19 10:16:29 +02:00