Commit Graph
2229 Commits
Author SHA1 Message Date
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
Andy Leiserson 3d0fe3a003 Check the math for buffer-texture copies 2025-07-08 12:11:56 -07:00
Andy Leiserson 361fe34392 Check the parent texture in TextureView::try_raw 2025-07-03 10:03:32 -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
Jim Blandy 2f890eb9b2 [core] Improve assert failure message for id epoch mismatches. (#7871) 2025-07-02 09:33:55 +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 7ff0bd784e fix!: remove WebGpuError impl. for Request{Adapter,Device}Error 2025-06-30 10:58:56 -04:00
Erich Gubler 964c5bbf4c feat(core): impl WebGpuError for API errors 2025-06-30 10:58:56 -04:00
Vecvec 27212104f8 Unify debug groups and markers. 2025-06-30 15:00:46 +02:00
Vecvec 6237dbf0b9 Unify timestamp writes. 2025-06-30 15:00:46 +02:00
Vecvec afa96af76f Unify set push constants. 2025-06-30 15:00:46 +02:00
Vecvec acd8cb18bb Unify rebinding resources. 2025-06-30 15:00:46 +02:00
Vecvec 4d36a02691 Unify set bind group. 2025-06-30 15:00:46 +02:00
Andy Leiserson e936c065fc Additional comments on render and compute pass encoding 2025-06-26 15:39:53 -07:00
Andy Leiserson 7722c341e0 Defer destroyed resource errors until cmdbuf submission 2025-06-26 15:39:53 -07:00
Andy Leiserson fc26fbc561 Deferred error reporting for render passes 2025-06-26 15:39:53 -07:00
Andy Leiserson 460f073a67 Deferred error reporting for compute passes 2025-06-26 15:39:53 -07: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
Andy Leiserson 3a5d0f2747 Deferred error reporting for other command encoder operations
* clear commands
* query set functions
* command_encoder_as_hal_mut
* ray_tracing
2025-06-17 16:17:43 -07:00
Andy Leiserson e702d1c116 Deferred error reporting for transfer commands 2025-06-17 16:00:49 -07: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
Andy Leiserson 620c9d1e8b Deferred error reporting for debug commands (#7789) 2025-06-12 11:53:32 -07:00
Erich Gubler cf83de3a5d chore!: remove deprecated type aliases for idents. in 2024-08 spec. rename (#7790)
This backs out commit 9436d56271.
2025-06-12 09:55:00 -04: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
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
Raphael Hetzel 0d569d5550 Optional web-specific deps for wasm32 (#7565) 2025-05-29 22:26:01 +00: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