Commit Graph

7928 Commits

Author SHA1 Message Date
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
Bruce Mitchener
20973d1cdc
Fix profiling with tracy. (#5988)
The profiling APIs require a `&str`, but since the label here
is now an `Option<String>`, we must get a `&str` from it.
2024-07-19 00:56:16 -04:00
Nicolas Silva
8aed6ed220
Update gpu-allocator dependency to 0.27 (#5982) 2024-07-18 19:18:32 -04:00
Connor Fitzgerald
80921f4720
Fix Codecov Timeout Issues (#5985) 2024-07-18 20:56:30 +00:00
Connor Fitzgerald
3c3b532cf3
Remove latest_submission_index (#5976)
* Remove latest_submission_index

* CI

* Comments
2024-07-18 16:43:39 +00:00
Erich Gubler
278d278b28 chore: remove non-existent wgpu-example workspace dep. 2024-07-18 11:55:08 -04:00
Erich Gubler
e883fa7b8b docs(CHANGELOG): add Unreleased section 2024-07-18 11:55:08 -04:00
Erich Gubler
6a1432c132 chore: release 22.0.0 2024-07-18 11:54:46 -04:00
teoxoy
9a0adefe88 use ManuallyDrop instead of Option for PendingWrites 2024-07-18 10:30:11 -04:00
teoxoy
77e45d46df add missing device valid check in create_texture_view 2024-07-18 10:29:08 -04:00
teoxoy
f767220399 remove same device check from create_texture_binding
`view.parent` will have the same `device` as the `view` itself
2024-07-18 10:29:08 -04:00
teoxoy
ed67ff289c [deno] remove assertDeviceMatch 2024-07-18 10:29:08 -04:00
teoxoy
63303d4b4e add missing same device checks 2024-07-18 10:29:08 -04:00
teoxoy
2f7860b6e4 move same device check in compute_pass_end_impl 2024-07-18 10:29:08 -04:00
teoxoy
7761b5723d move same device checks in render_pass_end 2024-07-18 10:29:08 -04:00
teoxoy
911d28fd1a add a few missing changelog entries 2024-07-18 14:25:12 +02:00
Jim Blandy
aeb2067e81 [core] Make poll(Wait) not hang after bad command submission.
Add `wgpu_core::device::Device::last_successful_submission_index`,
which records the fence value that `Maintain::Wait` should actually
wait for. See comments for details.

Fixes #5969.
2024-07-17 16:11:04 -07:00
Jim Blandy
2bc328c46f [hal, core] Introduce wgpu_hal::AtomicFenceValue, and use it.
Introduce the new type alias `wgpu_hal::AtomicFenceValue`, which is
the atomic version of `wgpu_hal::FenceValue`. Use this type alias in
`wgpu_core`. Remove `as` conversions made unnecessary since we're not
conflating `usize` with `u64` any more.
2024-07-17 16:11:04 -07:00
Jim Blandy
a47ed5dc1e [hal doc] Note wgpu_hal::Queue::submit's expectations for Fence. 2024-07-17 16:11:04 -07:00
Teodor Tanasoaia
69a1134e02
[wgpu] remove trace feature temporarily (#5975) 2024-07-17 18:10:49 +00:00
teoxoy
91924fb603 [wgpu-core] make implicit_pipeline_ids arg optional for users that don't provide IDs 2024-07-17 16:57:01 +02:00
Teodor Tanasoaia
7e112ca4c0
[wgpu-core] fix length of copy in queue_write_texture (#5973)
The size of the given `data` might be less than the size of the staging buffer.
This issue became apparent with the refactor in 6f16ea460a (https://github.com/gfx-rs/wgpu/pull/5946) since there is now an assert in `StagingBuffer.write()`.

Ruffle ran into this in https://github.com/gfx-rs/wgpu/issues/3193#issuecomment-2231209711.
2024-07-17 10:33:48 -04:00
teoxoy
241b52f7ea [example] add instructions to halmark 2024-07-17 14:03:11 +02:00
Teodor Tanasoaia
a3d2d31d3d
[test] allow WARP to run the zero-init workgroup memory test (#5968)
I pinpointed this to 438d6394ef (https://github.com/gfx-rs/wgpu/pull/3512).
I'm not sure why I didn't remove this one in 30064ead9f (https://github.com/gfx-rs/wgpu/pull/3515) as well, maybe I thought it was still failing due to early frees.
2024-07-16 12:30:53 -04:00
Teodor Tanasoaia
167f005c17
[tests] delete outdated comment on DEVICE_DESTROY_THEN_MORE test (#5967)
This was fixed by 6e21f7a929.
2024-07-16 12:30:35 -04:00