303 Commits

Author SHA1 Message Date
Connor Fitzgerald
2ff46cd7cd
Remove MULTI_DRAW_INDIRECT feature (#8162) 2025-08-28 12:00:14 -04:00
Magnus
17a17f716a
Initial precompiled shaders implementation (#7834)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-08-20 16:20:59 -04:00
Kevin Reid
2d835bf3b4 Call uncaptured error handler without the lock held.
This prevents a possible deadlock if the callback itself calls wgpu
operations.
2025-08-13 16:26:46 +01:00
Jamie Nicol
486c151772
[dx12,vulkan] Add support for P010 texture format (#8086)
P010 is a 4:2:0 chroma subsampled planar format, similar to NV12. Each
component uses 16 bits of storage, of which only the high 10 bits are
used. On DX12 this maps to DXGI_FORMAT_P010, and on Vulkan this maps to
G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16.

The existing "nv12" gpu test module has been renamed to
"planar_texture", and a new test P010_TEXTURE_CREATION_SAMPLING has
been added similar to the existing NV12_TEXTURE_CREATION_SAMPLING. The
remaining tests in this module have been converted to validation tests,
and now test both NV12 and P010 formats.
2025-08-13 15:35:20 +02:00
Marc Pabst
e7cdfc436a
Allow disabling waiting for latency waitable object (#7400) 2025-08-10 10:01:25 +00:00
sagudev
f04b3b020f
Remove lifetime from BufferSlice, BufferView, BufferViewMut (#8046) 2025-08-10 11:15:36 +02:00
Jamie Nicol
1bf1671ed8 [test] Add external texture GPU tests
These tests cover the external texture binding resource. They ensure
the WGSL functions `textureDimensions()`, `textureLoad()`, and
`textureSampleBaseClampToEdge()` work as expected for both
`TextureView`s and `ExternalTexture`s bound to external texture
resource bindings.

For external textures, they ensure multiplanar YUV formats work as
expected including handling color space transformation. And that the
provided sample and load transforms correctly handle cropping,
flipping, and rotation.
2025-08-06 17:31:50 +02:00
Jamie Nicol
bd85c9a99a [test] Rename existing external_texture tests to external_image_copy
These existing tests cover `Queue::copy_external_image_to_texture()`
which, despite the similar name, is unrelated to the external texture
binding resource.

The following patch is going to add some tests for the latter, so we
are taking this opportunity to rename the former to help avoid
confusion.
2025-08-06 17:31:50 +02:00
Jamie Nicol
8cd4bd602f [naga hlsl-out] Handle external texture color space conversion
This adds several fields to `ExternalTextureDescriptor`, specifying
how to handle color space conversion for an external texture. These
fields consist of transfer functions for the source and destination
color spaces, and a matrix for converting between gamuts. This allows
`ImageSample` and `ImageLoad` operations on external textures to
return values in a desired destination color space rather than the
source color space of the underlying planes.

These fields are plumbed through to the `ExternalTextureParams`
uniform buffer from which they are exposed to the shader. Following
conversion from YUV to RGB after sampling/loading from the external
texture planes, the shader uses them to gamma decode to linear RGB in
the source color space, convert from source to destination gamut, then
finally gamma encode to non-linear RGB in the destination color space.
2025-08-06 11:18:42 +01:00
Vecvec
a1168613d2
Prevent resources for acceleration structures being created if they are not enabled (#8036)
* Prevent resources for acceleration structures being created if acceleration structures aren't supported.
2025-08-04 09:37:09 -07:00
Connor Fitzgerald
3e153fb8ec Label no-op supporting tests 2025-08-01 01:54:01 -04:00
Connor Fitzgerald
09d0c94576 Use explicit test enumeration 2025-08-01 01:54:01 -04:00
Connor Fitzgerald
86d5211f84 Add support for running tests on the noop backend 2025-08-01 01:54:01 -04:00
Connor Fitzgerald
df40889e1b Prepare for miri 2025-08-01 01:54:01 -04:00
Andy Leiserson
1583c2481a
Another fix for texture copy validation (#8019) 2025-07-28 22:19:17 -04:00
SupaMaggie70Incorporated
074c0e7191
Add mesh shading api to wgpu & wgpu-core (#7345) 2025-07-24 20:58:56 -04:00
Jamie Nicol
f8756a6e1b [wgpu] Add external texture validation tests
Adds validation tests using the noop backend covering creation of
external textures, and creation of bind groups containing external
textures.
2025-07-22 15:38:15 -07:00
teoxoy
63f3df86c8 [wgpu-core] split command encoders from command buffers 2025-07-22 16:19:18 +02:00
Andy Leiserson
5d14f33259
Test for use of staging buffer in writeTexture (#7963) 2025-07-17 18:52:51 -04:00
Connor Fitzgerald
ff0de91ad7
Bump REPO_MSRV to 1.88 (#7960) 2025-07-17 13:00:40 -04:00
Vecvec
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
Kevin Reid
c0a8ba69b0 [ci] Check with profiling enabled.
Minimum version of `profiling` increases from ^1.0.0 to ^1.0.1 because
the `type-check` feature was added in 1.0.1.
2025-07-10 14:42:08 -04:00
Connor Fitzgerald
a851eba5f6
Add TextureView::texture (#7907) 2025-07-09 19:53:55 -04:00
teoxoy
fc6c529fa8 Adjust DEVICE_DESTROY_THEN_MORE test for spec compliance 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
cc0f4ac4bf refactor(wgpu)!: use WebGpuError for error classification 2025-06-30 10:58:56 -04:00
Erich Gubler
43eee99b29 refactor: extract did_fill_error_scope test helper from did_fail 2025-06-30 10:58:56 -04:00
Andy Leiserson
d13e9f5ebf
[tests] Test destruction of a used resource before submission (#7853)
* [tests] Test destruction of a used resource before submission

Fixes #5031

---------

Co-authored-by: Nicolas Silva <nical@fastmail.com>
2025-06-27 10:54:19 -07:00
Andy Leiserson
41badaedfb Update tests and changelog for deferred error reporting 2025-06-26 15:39:53 -07:00
Vecvec
dc0d457a9a
Add limits for acceleration structures (#7845) 2025-06-25 14:49:55 -04:00
Jim Blandy
3f96ba2980 Skip wgpu_gpu::oom::query_set_oom_test on Vulkan.
Vulkan's `VK_EXT_memory_budget` extension doesn't cover query sets, so
`wgpu_hal::vulkan::Device::error_if_would_oom_on_resource_allocation`'s
tactic doesn't work to anticipate OOM errors from the Vulkan driver
when creating query sets.

Without these checks, `wgpu_gpu::oom::query_set_oom_test` actually
consumes a significant amount of memory and attracts the attention of
the system's OOM killer. While it does get killed, the situation tends
to adversely affect the stability of the rest of the system, and thus
is not a friendly thing for a test run to do (#7817).

This change can be reverted once a suitable accounting method for
query sets has been implemented on Vulkan.
2025-06-18 08:21:13 -07: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
Jamie Nicol
d811258424 [naga msl-out] Add padding to end of structs if required 2025-06-17 20:20:25 +01: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
Vecvec
aa427de4ea
Remove unsafe acceleration structure build (#7513) 2025-06-12 00:43:03 -04:00
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
renovate[bot]
5a7af54619
chore(deps): update rust crate cargo_metadata to 0.20 (#7744)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2025-06-11 11:24:33 -04:00
Andy Leiserson
77d2b0017a
Split EncoderStateError from CommandEncoderError (#7779) 2025-06-10 09:46:30 -07: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
Raphael Hetzel
0d569d5550
Optional web-specific deps for wasm32 (#7565) 2025-05-29 22:26:01 +00:00
Dmitry Zamkov
9c023e5e29
Implement subgroup quad ops (#7683)
* Rudimentary impl of quad ops, impl quad ops for spirv

* Impl quad swap for hlsl, msl and wgsl, finish spv front

* Cargo clippy & cargo fmt, impl valid for quad ops

* Enable quad feature

* Add missing feature to glsl

* Simplifying code by making `SubgroupQuadSwap` an instance of `SubgroupGather`

* Add `GroupNonUniformQuad` spv capability to Vulkan

* Adding GPU tests for quad operations

* Validate that broadcast operations use const invocation ids

* Added changelog entry

---------

Co-authored-by: valaphee <32491319+valaphee@users.noreply.github.com>
2025-05-26 09:32:01 +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
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