185 Commits

Author SHA1 Message Date
Andy Leiserson
460f073a67 Deferred error reporting for compute passes 2025-06-26 15:39:53 -07:00
Andy Leiserson
e702d1c116 Deferred error reporting for transfer commands 2025-06-17 16:00:49 -07:00
Jamie Nicol
5f8d408fb8 [deno_webgpu] Add stub GPUExternalTexture implementation
This doesn't do anything yet, but unblocks running some CTS tests.
2025-06-17 20:20:25 +01:00
Andy Leiserson
afa0f71736
[deno] Fix dropping of command encoders/buffers, and an enum typo (#7808)
Fixes #7797
2025-06-16 10:50:19 -07:00
Andy Leiserson
620c9d1e8b
Deferred error reporting for debug commands (#7789) 2025-06-12 11:53:32 -07:00
Andy Leiserson
e9af205c71
[deno] Implement ShaderModule.getCompilationInfo (#7736) 2025-06-11 03:49:39 -04:00
Andy Leiserson
1d4891ab5a
[deno] Return undefined instead of null from Queue.submit (#7784) 2025-06-11 03:40:19 -04:00
Andy Leiserson
1194833a74
[deno] Make QuerySet.destroy a no-op for now (#7758)
Implementing it is tracked by #6495. In the mean time it is okay for it
to be a no-op. `destroy` just recovers the resources earlier than garbage
collection might, doing nothing is not a leak.
2025-06-09 10:22:42 -07:00
Andy Leiserson
233a25c1e5
Update to the latest CTS; run it on all platforms and on all PRs (#7752) 2025-06-05 22:04:45 -04:00
Zachary Harrold
6151330e3a
[wgpu-hal]: MVP no_std support (#7599)
* MVP `no_std` support in `wgpu-hal`

* Update CHANGELOG.md

* Fix visibility

* Fix unused imports

* Response to feedback

Co-Authored-By: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

* Update other `validation_canary` usages

Co-Authored-By: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

---------

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-05-30 12:31:44 -04:00
Andy Leiserson
3cca5f8cfd
Make the copy_buffer_to_buffer size parameter optional (#7659)
* Make wgpu-core's copy_buffer_to_buffer `size` parameter optional

* Make the copy size optional in more places

* Fix for webgpu backend

* [deno_webgpu] Support additional copyBufferToBuffer signatures

* Add changelog entry

* Add copyBufferToBuffer tests to CTS test list

(This doesn't actually enable the tests for the new overloads, because
of a different error reporting issue that affects many CTS tests
including these. But if you run the tests for the new overloads
manually, before and after the fix, you can see that the behavior has
changed.)

* Reproducible formula for vendoring modified webgpu-sys

Commit the updated vendor command in all the files for consistency.
2025-05-28 17:21:19 +02:00
Andy Leiserson
24d0eae36c
Remove another type of error that could be raised by destroy (#7720) 2025-05-24 17:02:00 +02:00
Andy Leiserson
fd6f16f598
Revive the CTS job (#7675)
Includes the following minor functional fixes to deno_webgpu:

* Don't throw an error immediately when `create_buffer` is called with invalid usage flags.
* Implement `on_submitted_work_done`.
* Correct validation of GPUExtent3D element count.
* Run without tracing (instead of panic) if the DENO_WEBGPU_TRACE env var is not set.

Fixes #6838
2025-05-21 09:52:03 -07:00
Andy Leiserson
26bab56fd5
[deno] Rework error and device loss handling (#7693) 2025-05-17 19:38:22 +02:00
Mehmet Oguz Derin
2a62299a84
Support Sliced 3D for ASTC (#7577)
Enables "texture-compression-astc-sliced-3d" for backends that support ASTC (such as excluding D3D12).
2025-05-04 12:48:16 +02:00
teoxoy
5ecc48d494 add RenderPassColorAttachment::depth_slice 2025-04-25 12:39:45 +02:00
teoxoy
3b72d59a3c make memory pressure detection optional and configurable 2025-04-22 09:21:27 +02:00
Sylvain Benner
14690470bb
[metal] Metal compute shader passthrough (#7326)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-04-09 14:25:41 +00:00
Connor Fitzgerald
c860a2cf8c
Rename and unsafe start_capture -> start_graphics_debugger_capture (#7470)
* Improve `start_capture` docs

* Docs
2025-04-03 13:07:22 -04:00
Kevin Reid
326ad03ce1 Move trace_dir/trace_path to a custom enum inside DeviceDescriptor.
This allows `wgpu` to not unconditionally depend on `std::path::Path`.
It’s also, in my opinion, more user-friendly, because the feature which
most users will not use (and is not currently functional) is now a
defaultable struct field instead of a required parameter.

The disadvantage is that `wgpu-types` now has to know about tracing.
2025-03-10 22:17:06 -04:00
Erich Gubler
6a01091397 move(core): s/create_compute_pass/begin_compute_pass/ 2025-02-17 12:42:10 -05:00
Erich Gubler
25a51606d1 move(core): s/create_render_pass/begin_render_pass/ 2025-02-17 12:42:10 -05:00
Connor Fitzgerald
d8833d0798
Use Update After Bind Descriptors for Bind Groups With Binding Arrays (#6815)
* Use Update After Bind Descriptors for Bind Groups With Binding Arrays

Update After Bind

x

* Comments

* Fix URL
2025-02-15 12:02:27 -05:00
Connor Fitzgerald
7e119968ce
Properly Deal with Timeouts (#7030) 2025-02-14 23:19:51 +00:00
Connor Fitzgerald
106b709798
Remove HashMaps from wgpu API (#7133)
* Remove HashMaps from Surface API

* Fix Comments and Errors
2025-02-14 14:36:22 -05:00
Leo Kettmeir
f0bf789f58
refactor(deno): use object wrap (#7113) 2025-02-13 04:17:00 -08:00
Kevin Reid
118a985ccd Allow creating Noop backend through the normal mechanisms. 2025-02-12 22:31:47 -05:00
sagudev
8e943e828c Unify ResolvedSurfaceOutput into SurfaceOutput
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-02-07 16:16:13 -05:00
sagudev
c0688b6de7 Unify ResolvedBufferBinding into BufferBinding
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-02-07 16:16:13 -05:00
sagudev
9db6430fdb ArcComputePassDescriptor
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-02-06 14:07:20 +01:00
@brody4hire - C. Jonathan Brody
df54acc05d
use hashbrown in more crates (etc.) (#6938)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-27 11:50:33 -05:00
Connor Fitzgerald
d8e7ab1ad1
Refactor Cargo.toml Significantly (#6980) 2025-01-23 22:49:48 +00:00
Connor Fitzgerald
a1fc4a0316
Allow Short Circuting GL Fences (#6942) 2025-01-21 19:28:14 +00:00
@brodycj - C. Jonathan Brody
beb33414c7
trace directory path updates (#6924)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-16 14:50:15 +00:00
Connor Fitzgerald
0f37714fb8
Separate Out Backend Options into Individual Structs (#6895) 2025-01-15 17:32:15 +00:00
Connor Fitzgerald
b0f1fa66ef
Add VisionOS Support (#6888)
* Add visionos support

* Use `target_vendor = "apple"`

* Fixes

* Build VisionOS

* Gah

* Bleh

* Typos

---------

Co-authored-by: Guus Waals <_@guusw.nl>
2025-01-10 17:33:58 +00:00
the letter L
1aabf22e7a
fix cts_runner (#6840)
* fix: unbreak compute_pass execution and state

* fix: cts_runner js_runtime needs Permissions struct

* fix: ColorWrites bitflags serde

---------

Co-authored-by: turbocrime <turbocrime@users.noreply.github.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-10 16:46:10 +00:00
Andreas Reich
fb210ab363
Pass InstanceDescriptor by reference and make it clonable (#6849) 2025-01-06 15:40:30 -05:00
Samson
ee3ae0e549
[core] Use higher level LoadOp,StoreOp (#6785) 2024-12-22 21:48:11 -05:00
Samson
d63ca09c34
Add usage to TextureViewDescriptor (#6755)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-12-18 18:38:28 +01:00
Leo Kettmeir
df825fec8c
chore: update deno (#6068)
---------

Co-authored-by: Luca Casonato <hello@lcas.dev>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: chirsz <chirsz@foxmail.com>
Co-authored-by: Hajime-san <41257923+hajime-san@users.noreply.github.com>
Co-authored-by: Volker Schlecht <47375452+vlkrs@users.noreply.github.com>
2024-12-18 08:01:50 -08:00
Samson
f6fec82853
[core] Allow depthClearValue to be empty (#6753) 2024-12-16 16:21:06 -05:00
Samson
4da7c263ed
[core] Support optional ops in PassChannel (#6716)
* Support optional ops in PassChannel

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* respect view format aspect

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-12-16 12:20:20 +01:00
Connor Fitzgerald
411ffa7a5a
Make Force Loop Bounding Optional (#6662)
* Make Force Loop Bounding Optional

Co-authored-by: rudderbucky <anandkwork7@gmail.com>

* Deprecate and Rename

---------

Co-authored-by: rudderbucky <anandkwork7@gmail.com>
2024-12-16 04:23:22 -05:00
Samson
8f82992b9f
Inline PassChannel into ColorAttachment (#6704)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-12-12 15:57:05 +01: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
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
teoxoy
13fbf30813 simplify BufferMapCallback by removing its C variant 2024-11-26 20:31:18 +01:00
teoxoy
39629d0de0 Improve the ownership story of textures returned by get_current_texture
`present` and `discard` will no longer automatically remove the texture from the registry.
2024-10-14 13:24:44 +02:00
Erich Gubler
fc2fd95a98
fix: handle Queue::submit non-fatally (#6318)
* Change the signature of `wgpu_core::Global::queue_submit` to return
  a `(SubmissionIndex, …)` in addition to its current error type.
* Change the control flow of errors in `Queue::submit` to break to the
  end of a block. This is similar to what we already do in many APIs in
  `wgpu_core`.
* Hoist the scope of the local `submit_index` binding so it can be used
  at the point where we need to convert current error paths to also
  return the submission index.

Later, we will likely want to avoid actually retrieving a new submission
index so we can minimize the critical section of code. We'll need to
figure out a strategy for returning a valid (but not necessarily unique)
index in the case of failures that prevent successful submission.
2024-09-25 02:52:25 +00:00