Commit Graph

9013 Commits

Author SHA1 Message Date
Erich Gubler
96c855b7ed chore: satisfy elided_named_lifetimes lint 2024-11-25 03:36:18 -05:00
Erich Gubler
9a43938e11 chore: satisfy clippy::manual_is_power_of_two
This only fires with Rust 1.83 or newer, but we can preempt this case
with our current MSRV.
2024-11-25 03:36:18 -05:00
Erich Gubler
e9b340d4d0 chore: satisfy clippy::manual_unwrap_or_default
This only fires with Rust 1.83 or newer, but we can preempt this case
with our current MSRV.
2024-11-25 03:36:18 -05:00
Erich Gubler
13a533022e chore: satisfy clippy::manual_div_ceil
This only fires with Rust 1.83 or newer, but we can preempt this case
with our current MSRV.
2024-11-25 03:36:18 -05:00
Erich Gubler
3032e9a43c chore: satisfy clippy::needless_lifetimes
These new cases only fire with Rust 1.83 or newer, but we can preempt
this case with our current MSRV.
2024-11-25 03:36:18 -05:00
Erich Gubler
8cf72dec8e chore: satisfy clippy::doc_lazy_continuation 2024-11-25 03:36:18 -05:00
Erich Gubler
ca410afb5f chore: satisfy clippy::assigning_clones
Started firing with Rust 1.78.0, but we can preempt it with our current
MSRV.
2024-11-25 03:36:18 -05:00
atlv
c22c062b54 fix typo (#6597) 2024-11-23 18:03:41 -05:00
Elie Michel
c54a159bab Improve binding error (#6553)
* Improve binding error

* Introduce a new BindingTypeName enum

* Fix formatting

* Use From trait instead of map functions for BindingTypeName

* Update CHANGELOG.md
2024-11-22 21:11:22 -05:00
atlv
b75f46cfbe fix typo (#6591) 2024-11-22 21:09:48 -05:00
atlv
e05e46c429 bump metal (#6592) 2024-11-22 21:09:22 -05:00
atlv
a0ea3050fd minor cleanup (#6593) 2024-11-22 20:51:50 -05:00
Teodor Tanasoaia
47bfede63f Add device_unregister_device_lost_closure (#6588)
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2024-11-22 19:49:47 +00:00
Erich Gubler
19d80fe229 refactor(core): extract Global::validate_pass_timestamp_writes 2024-11-22 13:50:29 -05:00
Erich Gubler
29e7fe3fe2 fix(core): validate that at least one pass timestamp write index is specified 2024-11-22 13:50:29 -05:00
Erich Gubler
b1ca9dfd1f chore: hoist std::mem::size_of import, Vulkan edition 2024-11-22 04:40:03 -05:00
Erich Gubler
a902645592 chore: satisfy unused_qualifications again, Vulkan edition 2024-11-22 04:40:03 -05:00
Samson
40fd5245df Update glow to 0.16 (#6586)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-11-22 08:49:03 +00:00
Erich Gubler
6365e2dd75 fix(core): validate dst_buffer isn't destroyed when resolving query sets 2024-11-21 23:23:15 -05:00
Erich Gubler
f1ec934dbc fix(core): validate that begin and end indices of pass timestamp writes are not equal 2024-11-21 23:22:15 -05:00
Erich Gubler
be50bdfc18 fix(core): validate bounds of pass timestamp writes' indices 2024-11-21 23:22:15 -05:00
Erich Gubler
ce1d6e4173 refactor: destructure timestamp writes in command_encoder_create_{compute,render}_pass 2024-11-21 23:22:15 -05:00
Erich Gubler
b17c30338d fix(core): validate TIMESTAMP_QUERY feature before other query set validation in pass creation 2024-11-21 23:22:15 -05:00
Xiaopeng Li
5ca92bf984 Fix leaks of WeakVec (#6576) 2024-11-21 10:47:05 +01:00
Jamie Nicol
00a6032eb7 [naga spv-out] Handle nested arrays when adding matrix decorations
Previously we only checked whether the outermost array's subtype was a
Matrix when determining whether to add ColMajor and MatrixStride
decorations, meaning arrays of arrays of matrices would not be
decorated.
2024-11-20 06:38:39 -08:00
Vecvec
6f5014f0a3 [wgpu-core/-hal] move raytracing alignments into hal (#6563) 2024-11-19 11:57:48 +01:00
fyellin
2389106a75 Fix set_push_constants for render bundles (#6540) 2024-11-19 11:12:21 +01:00
Jim Blandy
0b82776947 [naga msl-out] Avoid UB by making all loops bounded.
In MSL output, avoid undefined behavior due to unbounded loops by
adding an unpredictable, never-actually-taken `break` to the bottom of
each loop body, rather than adding an unpredictable,
never-actually-taken branch over each loop.

This will probably have more of a performance impact, because it
affects each iteration of the loop, but unlike branching over the
loop, which leaves infinite loops (and thus undefined behavior) in the
output, this actually ensures that no loop presented to Metal is
unbounded, so that there is no undefined behavior present that the
optimizer could use to make unwelcome inferences.

Fixes #6528.
2024-11-18 14:10:50 -08:00
Erich Gubler
e59f00399e fix(wgsl-in): include user and unknown rules in diagnostic(…) tracking 2024-11-18 17:10:07 -05:00
Erich Gubler
1fc5e4027a refactor: remove ConflictingDiagnosticRuleError::triggering_rule
Did this to decrease size of `ConflictingDiagnosticRuleError`, which
would have gotten even bigger in a subsequent commit.
2024-11-18 17:10:07 -05:00
Erich Gubler
ffc2a1e9a0 diag(wgsl-in): fix plurality agreement for conflicting diagnostic rules 2024-11-18 17:10:07 -05:00
Erich Gubler
f6f0e5dbc2 refactor(naga): unimpl. Copy for FilterableTriggeringRule 2024-11-18 17:10:07 -05:00
Jamie Nicol
6f528e2ebc [wgsl-in] Reject invalid texture types for textureSampleBias (#6566)
Non-sampled textures are not allowed, and neither are 1 dimensional
textures.
2024-11-18 17:37:52 +01:00
Jamie Nicol
baecb5fbf1 [wgsl-in] Ensure textureSampleLevel's level argument is an integer for depth textures (#6529)
Until now we accepted a float, as is the case for non-depth textures.
This makes us compliant with the spec.

The validator is updated to expect an Sint or Uint when the ImageClass
is ImageClass::Depth. The SPIR-V frontend converts the LOD argument
from float to Sint (assuming that it is representable), likewise The
SPIR-V backend now converts the LOD from either Sint or Uint to
Float. HLSL and MSL backends require no changes as they implicitly do
that conversion. GLSL does not support non-compare LOD samples,
therefore no changes are required.
2024-11-18 12:05:04 +00:00
Jim Blandy
c110bf22d8 docs(diagnostic_filter): add more words to DiagnosticFilterMap
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2024-11-15 16:11:07 -08:00
Teodor Tanasoaia
1abf3fe90e remove unused enum variants (#6550) 2024-11-15 14:25:18 +01:00
Erich Gubler
92ca5a3850 feat(wgsl-in): parse diagnostic attrs. on fns 2024-11-15 07:44:14 -05:00
Erich Gubler
ed29b2b758 fix(wgsl-in): yield conflict errors for full diagnostic(…) rule dupes in attr. pos. 2024-11-15 07:44:14 -05:00
David Peicho
3018912897 naga: Add support for GLSL signed/unsigned samplers (#6513) 2024-11-15 11:49:56 +01:00
François Mockers
4681f4ffba Fix iOS crash: don't set autoresizing mask (#6535) 2024-11-15 08:18:11 +00:00
teoxoy
278620be26 destroy subsequent command buffers if we encountered an error at submission
This gets the `wgpu_test::ray_tracing::as_build::out_of_order_as_build` test to pass.

This seems to be an issue even on trunk, looking at the nr of calls to `create_command_encoder` & `destroy_command_encoder` in hal, they are not equal. So, I'm not sure why the validation layers don't raise the `VUID-vkDestroyDevice-device-05137`.

There is still an issue with previous command buffers being leaked but I will fix this in a follow-up.
2024-11-14 06:27:37 -08:00
teoxoy
5a3de2d3a8 add a retry mechanism for waiting on the last submission in Queue::drop 2024-11-14 06:27:37 -08:00
teoxoy
d489e4c2e8 remove hal::Device::exit, add Drop implementations to Device and Queue instead 2024-11-14 06:27:37 -08:00
teoxoy
394bf37f98 expect to timeout when targeting WebGL 2024-11-14 06:27:37 -08:00
teoxoy
ddf0e67da7 wait for the last successful submission to complete before dropping the Queue 2024-11-14 06:27:37 -08:00
teoxoy
9e17e32686 extract Queue.maintain 2024-11-14 06:27:37 -08:00
teoxoy
5061ae3e5e map buffers immediately in map_async if the Queue has been dropped 2024-11-14 06:27:37 -08:00
teoxoy
6cc53421bf move LifetimeTracker into the Queue
The `Device` should not contain any `Arc`s to resources as that creates cycles (since all resources hold strong references to the `Device`).
Note that `LifetimeTracker` internally has `Arc`s to resources.
2024-11-14 06:27:37 -08:00
teoxoy
e934595bb2 move device_lost_closure from Device::life_tracker to Device 2024-11-14 06:27:37 -08:00
teoxoy
61c84f956e Remove outdated locking comments
We should rely on the ranks in `wgpu-core\src\lock\rank.rs`.
2024-11-14 06:27:37 -08:00