2144 Commits

Author SHA1 Message Date
Vecvec
73eb83ded1
[wgpu] Blas compaction (#7285)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-06-11 21:40:10 -04:00
Vecvec
efbac5dfba
Add extra acceleration structure vertex formats. (#7580) 2025-06-11 18:17:14 -04:00
Andy Leiserson
ce89c916f8
Add storage for an error in CommandEncoderStatus (#7785) 2025-06-11 09:56:14 -07:00
Jim Blandy
9046b439d7
Add more logging to Instance::device_request_adapter. (#7786) 2025-06-11 08:36:15 +00:00
Andy Leiserson
24f779696b
Tweak MapPassErr to work for both errors and results (#7780) 2025-06-10 10:26:36 -07:00
Andy Leiserson
77d2b0017a
Split EncoderStateError from CommandEncoderError (#7779) 2025-06-10 09:46:30 -07:00
Andy Leiserson
d9c4bf22ea
Panic on errors in pass_end_with_unresolved_commands (#7765) 2025-06-09 11:28:43 -07: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
Amogh Shivaram
55725d6483
Destroy texture views in clear_mode when destroying texture (#7705) 2025-05-19 22:44:25 -04:00
Lucien Greathouse
45b3d66301
Fix error message for sampler arrays (#7704) 2025-05-19 19:25:36 -07:00
Andy Leiserson
0dc6bfdd67
Don't raise AlreadyDestroyed error on repeated destroy() calls (#7686)
* Don't raise `AlreadyDestroyed` error on repeated `destroy()` calls

* Add changelog entry
2025-05-13 09:10:48 +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
Connor Fitzgerald
9fccdf5cf3
Extract texture <-> buffer copy logic to wgpu-types (#7553) 2025-04-28 21:15:59 +00:00
Jasper St. Pierre
38b6663f3c
validation: Fix type compatibility for streams vs. vertex inputs (#7600)
The old is_compatible_with handled scalar/scalar, scalar/vector, vector/vector, but was missing vector/scalar.

Since is_compatible_with is only used by vertex shader inputs, and vertex shader inputs can't be matrices (only scalars and vectors), we can actually simplify this by removing the other match and just only checking the kind.

Fixes #7568
2025-04-25 15:08:27 +02:00
teoxoy
d14849df48 [vk] add support for rendering to slices of 3D textures 2025-04-25 12:39:45 +02:00
teoxoy
d714e3d95a [d3d12,metal,gl] add support for rendering to slices of 3D textures 2025-04-25 12:39:45 +02:00
teoxoy
15477b84a9 [wgpu-hal] make begin_render_pass fallible 2025-04-25 12:39:45 +02:00
teoxoy
5ecc48d494 add RenderPassColorAttachment::depth_slice 2025-04-25 12:39:45 +02:00
teoxoy
6058dd4296 [wgpu-core] allow 2D-Array texture views with a single layer to be used as render attachments 2025-04-25 12:39:45 +02:00
Teodor Tanasoaia
195217b269
allow read-write and read-only storage textures without TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES (#7623) 2025-04-24 11:45:24 -04:00
Zachary Harrold
66263789bc
[wgpu-core]: Remove x_instead_of_y exceptions (#7598) 2025-04-23 03:17:29 +00:00
teoxoy
3b72d59a3c make memory pressure detection optional and configurable 2025-04-22 09:21:27 +02:00
teoxoy
7b482622d3 allow sampler creation to return OOMs
This is to preserve the current behavior as tested by the `SAMPLER_CREATION_FAILURE` test.

This is not spec compliant but it's unclear what we should do instead. I opened https://github.com/gpuweb/gpuweb/issues/5142 to figure out what we should do.
2025-04-22 09:21:27 +02:00
teoxoy
c13fc3d141 don't call release_gpu_resources when losing the device
This removes the possibility of deadlocks happening since `release_gpu_resources` tries to lock resources (trackers, snatchable_lock, pending_writes, life_tracker) while they might be already locked; `handle_hal_error` is called in lots of places.

Removing the call only delays destruction since `release_gpu_resources` is still called in `maintain`.
2025-04-22 09:21:27 +02:00
teoxoy
ece29b6e68 [D3D12/VK] add OOM check on submit and poll that will lose the device if we are over 95% of our budget 2025-04-22 09:21:27 +02:00
teoxoy
c144f2a697 invalidate Device on OOM errors with the exception of buffer, texture, query set and acceleration structure creation 2025-04-22 09:21:27 +02:00
teoxoy
c49620d1a2 add device validity checks to Queue methods 2025-04-22 09:21:27 +02:00
RedMindZ
f64eae7734
Fixed a deadlock caused by locking the device's snatchable lock **after** locking the queue's pending writes (#7582) 2025-04-21 11:08:57 -04:00
Ebbe Steenhoudt
7cab1747ee
Loosen Viewport validation requirements to match the new specs (#7564) 2025-04-18 15:17:53 +02:00
teoxoy
597114052e [d3d12] get vertex_index & instance_index builtins working for indirect draws 2025-04-15 17:56:17 +02:00
Teodor Tanasoaia
78d05f5f71
[core] check that indirect buffers have not been destroyed (#7534) 2025-04-14 11:06:32 -04:00
Bruce Mitchener
dde9422114
Fix build with profiling enabled (#7509) 2025-04-11 00:34:05 +00:00
Vecvec
8010203281 Rework acceleration structure build tracking. 2025-04-09 22:27:04 -04:00
Vecvec
382a1e3c9b Make submission index lockable. 2025-04-09 22:27:04 -04:00
Vecvec
1c4b73c098
Implement as_hal for BLASes and TLASes (#7303) 2025-04-09 14:50:43 -04: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
Vecvec
e8e66afb72
Fix new acceleration structure building validation errors. (#7486) 2025-04-07 15:17:06 +02: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
Connor Fitzgerald
c344bec508 Comments 2025-04-03 10:35:20 -04:00
Connor Fitzgerald
6a986f4bc4 Timestamp normalization 2025-04-03 10:35:20 -04:00
Josh Groves
ab38e8e430
Avoid overflows for extreme scissor coordinates (#7459) 2025-04-01 09:47:39 -04:00
Connor Fitzgerald
a9279de793
Fix assorted issues with WebGL (#7448)
* Fix validation error when configuring the surface on WebGL

* Remove unneeded `webgl` feature

* Fix compilation of the `noop` backend on `wasm32`

* Prevent `webgpu` examples from incorrectly falling back to WebGL

* Reduce dependency set when building wasm examples

* Fix various warnings
2025-03-31 22:02:21 -04:00
Erich Gubler
1d4740e89d build: upgrade ron 0.8.1 → 0.9.0 2025-03-26 16:03:03 -04:00
teoxoy
9a2b5fdb70 abstract away usage of scratch space for buffer barriers and unique index iterators 2025-03-26 18:26:31 +00:00
teoxoy
3705928273 [validate_draw] refactor out an is_bit_set function 2025-03-26 18:26:31 +00:00
teoxoy
7d15c511de move indirect validation code to its own folder
rename items appropriately
internalize indirect buffer bind groups
2025-03-26 18:26:31 +00:00
teoxoy
ef622c1061 validate multi draw indirect calls 2025-03-26 18:26:31 +00:00
teoxoy
0285e60984 Replace the indirect-validation feature with InstanceFlags::VALIDATION_INDIRECT_CALL.
With the only caveat that device creation will now panic if the `wgsl` feature is not enabled, `InstanceFlags::VALIDATION_INDIRECT_CALL` is set and the device supports `DownlevelFlags::INDIRECT_EXECUTION`.
2025-03-26 18:26:31 +00:00
teoxoy
53c2d15e0b implement indirect draw validation 2025-03-26 18:26:31 +00:00