Commit Graph

8363 Commits

Author SHA1 Message Date
Jasper St. Pierre
390a4169fb naga: Don't consider per-polygon inputs to be subgroup uniform
Implementations can absolutely pack multiple triangles per subgroup.

Fixes #6270.
2024-09-22 03:57:41 -04:00
Connor Fitzgerald
39cfeefd8b
Update CI Dependencies (#6306) 2024-09-22 04:35:26 +00:00
Erich Gubler
2f81ae156c
style: use concat!(…) in DOWNLEVEL_*_MESSAGE (#6305) 2024-09-22 00:27:32 +00:00
Erich Gubler
841e7c8857
fix: only log Device::maintain waits if they happen (#6303) 2024-09-21 18:47:35 +02:00
Erich Gubler
9977edc51f
chore!: remove #[no_mangle] … extern "C" … from fns in bundle_ffi (#6272) 2024-09-21 16:33:13 +00:00
Hamir Mahal
14abdd4754
fix: usage of a deprecated Node.js version in CI (#6301) 2024-09-20 19:43:10 +00:00
Ben Reeves
9f85f8aeea
fix(wgpu): Raise validation error instead of panicking in get_bind_group_layout. (#6280) 2024-09-20 09:32:01 +02:00
Erich Gubler
b54fb72d4a
chore: un-regress unused_qualifications lint in naga::front::spv (#6297)
Regressed in #5824.
2024-09-20 09:29:05 +02:00
Vecvec
dfc384a7fd
Stop Vulkan generating validation error in build acceleration structures (#6282) 2024-09-18 23:02:25 +02:00
Erich Gubler
0d339fc9f1
chore: suppress unused_qualifications for wgpu_core::id const. assertions (#6295) 2024-09-18 21:48:04 +02:00
Erich Gubler
f942ceef9b docs(msl-out): note that Dawn also avoids loop UB like we do 2024-09-18 09:12:58 -07:00
Jim Blandy
3fda684eb9 [naga msl-out] Defeat the MSL compiler's infinite loop analysis.
See the comments in the code for details.

This patch emits the definition of the macro only when the first loop
is encountered. This does make that first loop's code look a bit odd:
it would be more natural to define the macro at the top of the
file. (See the modified files in `naga/tests/out/msl`.)

Rejected alternatives:

- We could emit the macro definition unconditionally at the top of the
  file. But this changes every MSL snapshot output file, whereas only
  eight of them actually contain loops.

- We could have the validator flag modules that contain loops. But the
  changes end up being not small, and spread across the validator, so
  this seems disproportionate. If we had other consumers of this
  information, it might make sense.

- We could change the MSL backend to allow text to be generated out of
  order, so that we can decide whether to define the macro after we've
  generated all the function bodies. But at the moment this seems like
  unnecessary complexity, although it might be worth doing in the
  future if we had additional uses for it - say, to conditionally emit
  helper function definitions.

Fixes #4972.
2024-09-18 11:01:51 -04:00
dependabot[bot]
c3ab12aa29
build(deps): bump the patch-updates group across 1 directory with 11 updates (#6293)
Bumps the patch-updates group with 11 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.87` | `1.0.89` |
| [glow](https://github.com/grovesNL/glow) | `0.14.0` | `0.14.1` |
| [arrayref](https://github.com/droundy/arrayref) | `0.3.8` | `0.3.9` |
| [bytes](https://github.com/tokio-rs/bytes) | `1.7.1` | `1.7.2` |
| [cc](https://github.com/rust-lang/cc-rs) | `1.1.18` | `1.1.21` |
| [memmap2](https://github.com/RazrFalcon/memmap2-rs) | `0.9.4` | `0.9.5` |
| [rustix](https://github.com/bytecodealliance/rustix) | `0.38.36` | `0.38.37` |
| [toml_edit](https://github.com/toml-rs/toml) | `0.22.20` | `0.22.21` |
| [unicode-ident](https://github.com/dtolnay/unicode-ident) | `1.0.12` | `1.0.13` |
| [unicode-normalization](https://github.com/unicode-rs/unicode-normalization) | `0.1.23` | `0.1.24` |
| [unicode-segmentation](https://github.com/unicode-rs/unicode-segmentation) | `1.11.0` | `1.12.0` |



Updates `anyhow` from 1.0.87 to 1.0.89
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.87...1.0.89)

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

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

Updates `bytes` from 1.7.1 to 1.7.2
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.7.1...v1.7.2)

Updates `cc` from 1.1.18 to 1.1.21
- [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.18...cc-v1.1.21)

Updates `memmap2` from 0.9.4 to 0.9.5
- [Changelog](https://github.com/RazrFalcon/memmap2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/memmap2-rs/compare/v0.9.4...v0.9.5)

Updates `rustix` from 0.38.36 to 0.38.37
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Changelog](https://github.com/bytecodealliance/rustix/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.36...v0.38.37)

Updates `toml_edit` from 0.22.20 to 0.22.21
- [Commits](https://github.com/toml-rs/toml/compare/v0.22.20...v0.22.21)

Updates `unicode-ident` from 1.0.12 to 1.0.13
- [Release notes](https://github.com/dtolnay/unicode-ident/releases)
- [Commits](https://github.com/dtolnay/unicode-ident/compare/1.0.12...1.0.13)

Updates `unicode-normalization` from 0.1.23 to 0.1.24
- [Commits](https://github.com/unicode-rs/unicode-normalization/compare/v0.1.23...v0.1.24)

Updates `unicode-segmentation` from 1.11.0 to 1.12.0
- [Commits](https://github.com/unicode-rs/unicode-segmentation/compare/v1.11.0...v1.12.0)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: glow
  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: bytes
  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: memmap2
  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: toml_edit
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: unicode-ident
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: unicode-normalization
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: unicode-segmentation
  dependency-type: indirect
  update-type: version-update:semver-minor
  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-09-18 10:34:12 -04:00
mahkoh
ab9a78c64b
Update parking_lot dependency (#6287)
wgpu-hal does not compile with parking_lot versions that don't contain const Mutex::new.
2024-09-18 13:53:50 +00:00
Schell Carl Scivally
fc85e4f970
spv-in parse more atomic ops (#5824)
* add parsing for spirv::Op::AtomicLoad and spirv::Op::AtomicStore

* spv-in parse AtomicExchange and AtomicCompareExchange

* add atomic i decrement

* bookend atomic store statement with emmitter.finish/emitter.start to suppress a double load expression

bookend atomic result expressions with emitter.finish/start to prevent double defs

* add atomic iadd, isub, smin, umin, smax, umax, and, or, xor

* parse atomic flag test and set, parse atomic flag clear

* remove atomic compare exchange work

* changelog

* moved spirv tests into front/spv/mod.rs

* feature gate atomic spv tests because they require wgsl-[in,out]

* BlockContext::get_contained_global_variable returns Result

* Generate spans covering the entire instruction.

Granted, there is pre-existing code in the SPIR-V front end that gets
this wrong, but:

It doesn't make sense to read `self.data_offset`, and then immediately
pass that to `self.span_from_with_op`. The point of that function is
to make the span cover the entire instruction, operands included.

* Move `From` implementation into spv front end

* doc comments, minor cleanups

* remove parsing of OpAtomicFlagClear and OpAtomicFlagTestAndSet

* sync atomic spvasm files

---------

Co-authored-by: Jim Blandy <jimb@red-bean.com>
2024-09-18 05:39:36 +00:00
Ben Reeves
434f197410
Document default pipeline layout behavior. (#6275)
* Document default pipeline layout behavior.

Fixes #6254.

* Fix typo

* Apply suggestions from code review

Co-authored-by: Andreas Reich <r_andreas2@web.de>

* Remove text about panics in get_bind_group_layout.

We shouldn't advertise the behavior until it is consistent between
webgpu and wgpu-core.

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-09-15 23:08:13 +02:00
Ben Reeves
2fac5e983e
Properly handle the case where Navigator.gpu is undefined and WebGPU is the only compiled backend (#6197)
* Properly handle the case where `Navigator.gpu` is undefined and WebGPU is the only compiled backend.

Previously, `Instance::request_adapter` would invoke a wasm binding with an undefined arg0,
thus crashing the program. Now it will cleanly return `None` instead.

Fixes #6196.

* Fix typo in `Instance::new` doc comment.
* Add note to CHANGELOG.md
* Introduce `DefinedNonNullJsValue` type.
* Assert definedness of self.gpu in surface_get_capabilities.
* Use DefinedNonNullJsValue in signature of get_browser_gpu_property().
* Clarify meaning of gpu field with a comment.
2024-09-15 08:07:40 +00:00
Johann Muszynski
d79ebc4db3
Update some docs containing OpenGL or GLSL references (#6271) 2024-09-15 07:07:39 +00:00
Ben Reeves
a21c0e2696
Clarify cfg(send_sync) gating in this backend/webgpu comment. (#6274)
Addresses the confusion in #6267.
2024-09-15 04:44:17 +00:00
Dzmitry Malyshau
eb18854b46 spv-out: configure source language in debug info 2024-09-13 11:37:23 -07:00
Teodor Tanasoaia
c8beade187
remove backend from ID (#6263) 2024-09-13 17:30:38 +02:00
Teodor Tanasoaia
ff52b86331
[d3d12] handle absence of Windows SDK (#6262) 2024-09-13 15:56:26 +02:00
Daniel McNab
c2e0ad293f
Vulkan: Avoid undefined behaviour with adversarial debug label (#6257) 2024-09-12 15:03:04 +02:00
Adam Winiarczuk
f3cbd6ce54
fix: Set mip_level_count in TextureInitTracker for externally created textures (#6249)
Co-authored-by: Adam Winiarczuk <tsu@liv.tv>
2024-09-10 22:28:36 +00:00
teoxoy
c4110afc7f [wgpu-core] inline Storage.insert_impl() 2024-09-10 11:58:54 +02:00
teoxoy
2addb267fc [wgpu-core] remove FutureId.into_id() 2024-09-10 11:58:54 +02:00
teoxoy
c182d3f24f [wgpu-core] rename .strict_unregister() & .strict_remove() to .remove() 2024-09-10 11:58:54 +02:00
teoxoy
ac74f36590 [wgpu-core] rename .strict_get() to .get() 2024-09-10 11:58:54 +02:00
teoxoy
31edbfd0dc [wgpu-core] use .strict_get() & .strict_unregister() for command buffers
We now only rely on the presence of the inner `CommandBufferMutable` to determine if command buffers are invalid.
2024-09-10 11:58:54 +02:00
teoxoy
c0c594eff2 [wgpu-core] use Fallible for RenderBundle 2024-09-10 11:58:54 +02:00
teoxoy
ee3b63a9af [wgpu-core] use Fallible for PipelineCache 2024-09-10 11:58:54 +02:00
teoxoy
5bcdd4266e [wgpu-core] use Fallible for ShaderModule 2024-09-10 11:58:54 +02:00
teoxoy
1c5793afb3 [wgpu-core] use Fallible for PipelineLayout 2024-09-10 11:58:54 +02:00
teoxoy
e444e78d94 [wgpu-core] use Fallible for BindGroupLayout 2024-09-10 11:58:54 +02:00
teoxoy
45206e553d [wgpu-core] use Fallible for RenderPipeline 2024-09-10 11:58:54 +02:00
teoxoy
82ce2ea747 [wgpu-core] use Fallible for ComputePipeline 2024-09-10 11:58:54 +02:00
teoxoy
b42500ee40 [wgpu-core] use Fallible for BindGroup 2024-09-10 11:58:54 +02:00
teoxoy
2ea314e978 [wgpu-core] remove Arc around StagingBuffer 2024-09-10 11:58:54 +02:00
teoxoy
b14fe14e88 [wgpu-core] use Fallible for QuerySet 2024-09-10 11:58:54 +02:00
teoxoy
3ed1abc492 [wgpu-core] use Fallible for Sampler 2024-09-10 11:58:54 +02:00
teoxoy
04f17d4197 [wgpu-core] use Fallible for TextureView 2024-09-10 11:58:54 +02:00
teoxoy
c630821f1d [wgpu-core] use Fallible for Texture 2024-09-10 11:58:54 +02:00
teoxoy
68e8b7d4a8 [wgpu-core] introduce Fallible and use it for Buffer (first step of invalidity internalization) 2024-09-10 11:58:54 +02:00
teoxoy
3437589107 [wgpu-core] use .strict_get() & .strict_unregister() for devices
This works because we never assign errors to devices (they are never invalid).
2024-09-10 11:58:54 +02:00
teoxoy
07c397a1e5 [wgpu-core] use .strict_get() & .strict_unregister() for queues
This works because we never assign errors to queues (they are never invalid).
2024-09-10 11:58:54 +02:00
teoxoy
aa280ecd44 [wgpu-core] change return type of device creation methods to be more rusty
This is fine from the WebGPU spec's perspective as device creation returns a promise that can reject.
2024-09-10 11:58:54 +02:00
teoxoy
da9afea271 [wgpu-core] use .strict_get() & .strict_unregister() for surfaces
This works because we never assign errors to surfaces (they are never invalid).
2024-09-10 11:58:54 +02:00
teoxoy
98426329a4 [wgpu-core] introduce Registry .strict_get() & .strict_unregister() and use them for adapters
This works because we never assign errors to adapters (they are never invalid).
2024-09-10 11:58:54 +02:00
teoxoy
70a9c01b48 [wgpu-core] make the Registry generic over T: Clone 2024-09-10 11:58:54 +02:00
teoxoy
d550342f47 [wgpu-core] use device.instance_flags when possible 2024-09-10 11:58:54 +02:00