Commit Graph
1199 Commits
Author SHA1 Message Date
Lucas Abel 13d0cd4d58 [core] fix invalid read in Queue::write_texture (#7893) 2025-07-16 09:49:03 -07:00
Andy Leiserson c868142709 Validate vertex and index buffer alignment (#7929) 2025-07-11 14:43:03 -07:00
VecvecandConnor Fitzgerald 4844fa6b5e Merge acceleration structure feature and ray query feature. (#7913)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-07-10 19:53:32 +00:00
Andy Leiserson 468632f207 Restore plumbing of implicit remainder-of-buffer size to backends 2025-07-10 09:52:20 -07:00
Andy Leiserson 27e7408f16 Restore the buffer size changes 2025-07-10 09:52:20 -07:00
Connor Fitzgerald a248b8caf3 [core] Add RawResourceAccess trait 2025-07-09 18:08:11 -04:00
Andy Leiserson 9834d9a446 Revert "Validate binding ranges against buffer size"
This reverts commit ef428fcab8.
2025-07-09 16:29:41 -04:00
Andy Leiserson b0527800a1 Revert "Restore unintentional support for zero-size buffers"
This reverts commit c0a580d6f0.
2025-07-09 16:29:41 -04:00
Andy Leiserson c0a580d6f0 Restore unintentional support for zero-size buffers 2025-07-08 14:45:12 -07:00
Andy Leiserson ef428fcab8 Validate binding ranges against buffer size 2025-07-08 14:45:12 -07:00
teoxoy 487f79ba44 Add missing device validity checks 2025-07-02 11:11:37 +02:00
teoxoy e10e17907f remove DeviceError::ResourceCreationFailed 2025-07-02 11:11:37 +02:00
teoxoy 918fdc98b5 remove reason from ErrorType::DeviceLost since it's always "unknown" and users should register the lost callback instead 2025-07-02 11:11:37 +02:00
teoxoy 25d75e2a02 remove DeviceError::Invalid, this variant should be the same as DeviceError::Lost 2025-07-02 11:11:37 +02:00
Andy Leiserson 86e6b1835b Tolerate destruction of textures used in immediate queue operations prior to submit 2025-06-30 10:29:50 -07:00
Erich Gubler 964c5bbf4c feat(core): impl WebGpuError for API errors 2025-06-30 10:58:56 -04:00
Andy Leiserson 09c08037c9 Add a field in BasePass to store errors 2025-06-26 15:39:53 -07:00
SupaMaggie70IncorporatedandConnor Fitzgerald e40e66d205 DXIL & HLSL passthrough (#7831)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-06-25 18:12:58 -04:00
Vecvec dc0d457a9a Add limits for acceleration structures (#7845) 2025-06-25 14:49:55 -04:00
Jamie Nicol 8cdbcc1755 Add ExternalTexture BindingType behind new Feature flag
Adds a new feature flag, `EXTERNAL_TEXTURE`, indicating device support
for our implementation of WebGPU's `GPUExternalTexture` [1] which will
land in upcoming patches. Conceptually this would make more sense as a
downlevel flag, as it is a core part of the WebGPU spec which we do not
yet support. We do not want, however, to cause applications to reject
adapters because we have not finished implementing this, so for now we
are making it an opt-in feature.

As an initial step towards supporting this feature, this patch adds a
new `BindingType` corresponding to WebGPU's
`GPUExternalTextureBindingLayout` [2]. This binding type dictates that
when creating a bind group the corresponding entry must be either an
external texture or a texture view with certain additional requirements
[3].

As of yet wgpu has no concept of an external texture (that will follow
in later patches) but for now this patch ensures that texture views
corresponding to an external texture binding type are validated
correctly. Note that as the feature flag is not yet supported on any
real backends, bind group layout creation will fail before getting the
chance to attempt to create a bind group. But in the added tests using
the noop backend we can see this validation taking place.

[1] https://www.w3.org/TR/webgpu/#gpuexternaltexture
[1] https://www.w3.org/TR/webgpu/#dictdef-gpuexternaltexturebindinglayout
[2] https://gpuweb.github.io/gpuweb/#bind-group-creation
2025-06-17 15:00:29 -07:00
Dmitry Zamkov bbb7cc79ef Implement clip-distances extension for GL and Vulkan backends (#7730)
* Basic implementation of `clip_distances` for Vulkan and GL backends

* Added GPU test for `clip-distances`

* Update feature array size

* Add changelog entry

* Validate `clip_distances` array size

* Check for `clip_distances` enable directive

* Consolidate code for generating `enable` directives in WGSL backend and add `clip_distances`.
2025-06-16 10:33:31 +02:00
Vecvec aa427de4ea Remove unsafe acceleration structure build (#7513) 2025-06-12 00:43:03 -04:00
VecvecandConnor Fitzgerald 73eb83ded1 [wgpu] Blas compaction (#7285)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-06-11 21:40:10 -04:00
Andy Leiserson ce89c916f8 Add storage for an error in CommandEncoderStatus (#7785) 2025-06-11 09:56:14 -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
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 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 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
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
teoxoy 597114052e [d3d12] get vertex_index & instance_index builtins working for indirect draws 2025-04-15 17:56:17 +02: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
Sylvain BennerandConnor Fitzgerald 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
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
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
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 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
Bruce Mitchener ccaf9a84f8 Fix clippy::implicit_saturating_sub lints (#7395) 2025-03-22 13:17:34 -04:00
Connor Fitzgerald 4687973c9a Use bytemuck instead of slice::from_raw_parts for transmutes (#7376) 2025-03-19 22:05:21 -04:00