Commit Graph

8483 Commits

Author SHA1 Message Date
Dzmitry Malyshau
cdcba54d06 Declare ray flags in IR, parse all of them in WGSL 2024-11-27 11:49:32 +01:00
Jim Blandy
8fce9f6191 [core] Make insert_or_merge a method of BufferUsageScope.
Change `wgpu_core::track::buffer::insert_or_merge` into a
method of `BufferUsageScope`, replacing three arguments with `self`.
2024-11-27 02:00:03 -05:00
Jim Blandy
eaa5fea40d [core] Make insert_or_barrier_update a method of BufferTracker.
Change `wgpu_core::track::buffer::insert_or_barrier_update` into a
method of `BufferTracker`, and replace four arguments with `self`.
2024-11-27 02:00:03 -05:00
Erich Gubler
170f457f71 refactor: handle 2024-08 spec. rename for image copy APIs in deno_webgpu/ 2024-11-26 23:16:35 -05:00
Erich Gubler
9436d56271 feat(types): add deprecated type aliases for idents. in 2024-08 spec. rename 2024-11-26 23:16:35 -05:00
Erich Gubler
c05aa105f2 refactor!: handle 2024-08 spec. rename of image copy APIs
This commit was authored by running the following Nushell script, using
the `nu` binary and the lovely `fastmod` tool:

```nushell
# Copy-pasted from the OP in [`gpuweb`#4838](https://github.com/gpuweb/gpuweb/pull/4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update old { strip_gpu_prefix | str trim }
  | update new { strip_gpu_prefix | str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

def strip_gpu_prefix []: string -> string {
  $in | str replace --regex '^GPU' ''
}

# Rename image APIs.
for entry in $renames_table {
  fastmod --accept-all --fixed-strings $entry.old $entry.new --iglob '!CHANGELOG.md' --iglob "!xtask/src/vendor_web_sys.rs" --iglob '!wgpu/src/backend/webgpu/webgpu_sys/' --iglob '!deno_webgpu/' --iglob '!wgpu/src/backend/webgpu.rs'
}
cargo fmt
```

…and cleaning up `deno_webgpu/`'s Rust compilation errors.
2024-11-26 23:16:35 -05:00
Jasper St. Pierre
7fff667c5a [glsl-in] Don't reinterpret function arguments twice in the normal case
We already lowered the function expression if it's a normal in argument; no need to do it again. This eliminates an unused variable and expression. With chained function calls, this could lead to a lot of waste.

There's still an extra unused expression in the case of an out/inout argument; ideally we'd remove these expressions, but it might be tricky.

Fixes #6602
2024-11-26 11:32:15 -08:00
teoxoy
e2eeba7dae [wgpu-core] document which closures are guaranteed to be called 2024-11-26 20:31:18 +01:00
teoxoy
14af686b9f Remove device_unregister_device_lost_closure 2024-11-26 20:31:18 +01:00
teoxoy
86656e182b simplify DeviceLostClosure by removing its C variant 2024-11-26 20:31:18 +01:00
teoxoy
13fbf30813 simplify BufferMapCallback by removing its C variant 2024-11-26 20:31:18 +01:00
teoxoy
8e4622b399 simplify SubmittedWorkDoneClosure by removing its C variant 2024-11-26 20:31:18 +01:00
teoxoy
f4bdd1cb65 remove Dropped & ReplacedCallback variants of DeviceLostReason 2024-11-26 20:31:18 +01:00
teoxoy
f096c66938 remove DeviceLostClosure consumed check 2024-11-26 20:31:18 +01:00
teoxoy
816e9c5856 use FnOnce instead of Fn for the device lost closure 2024-11-26 20:31:18 +01:00
sotaroikeda
9ffafcf7b8 Add Metal SharedEvent to fence if it is supported (#6610)
Co-authored-by: Sotaro Ikeda <you@example.com>
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2024-11-26 19:25:07 +00:00
Sludge
a9f14c7a90 Allow 64-bit hex literals and const-evaluate unary ops (#6616)
* Allow 64-bit hex literals

* Implement const evaluation for unary 64-bit ops

* Test 64-bit hex literals

* Add changelog entry
2024-11-25 18:54:12 -08:00
Erich Gubler
3016c56db6 chore(naga): suppress irrefutable_let_patterns for EnableExtension matching in Error::as_parse_error (#6607) 2024-11-25 13:52:16 +01:00
atlv
05c9f43fa8 Fix atomic storage global use acces (#6600) 2024-11-25 12:06:12 +01:00
Andreas Reich
29bb44b19a Bump version & update changelog following 23.0.1 patch release (#6612)
* put in missing v22.1.0 changelog

* bump wgpu, wgpu-core, wgpu-hal to 23.0.1

* add changelog for v23.0.1, remove lines from v24 line
2024-11-25 09:54:49 +01:00
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