996 Commits

Author SHA1 Message Date
Andy Leiserson
4853133eaa Fix buffer initialization tracking for some buffer-texture copies (#8099)
Fixes #7947
Fixes #8021
Fixes #8097
2025-09-04 14:15:31 -07:00
Andy Leiserson
989d48ccb6 Tweak the bytes_per_row alignment check
Previously, the check was skipped if the copy was a single row, which is
not correct. The check should be made whenever bytes_per_row is
specified. It is permissible not to specify bytes_per_row if the copy is
a single row, but if it is specified, it must be aligned.

Also removes a redundant check of the `offset` alignment.

Since the offset and bytesPerRow alignment checks are not part of
"validating linear texture data", I chose to remove that instance of
them. These checks are now in `validate_texture_buffer_copy`, which
does not correspond 1:1 with the spec, but has a comment explaining how
it does correspond.
2025-09-04 14:15:31 -07:00
Connor Fitzgerald
c488bbe604
[wgpu] Improve buffer mapping errors and allow multiple immutable borrows (#8150)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2025-09-02 12:21:16 -04:00
Connor Fitzgerald
8d1f4bb5f2
Require token for experimental features (#8163) 2025-08-29 15:43:27 -04:00
Matthias Reitinger
80a742094c
[wgpu-core] Improve errors for forbidden texture copy formats (#8156)
TransferError now has separate variants for texture copy formats that
are only forbidden in combination with specific aspects
(CopyFrom/ToForbiddenTextureFormatAspect), and texture copy formats that
are always forbidden, irrespective of the aspect
(CopyFrom/ToForbiddenTextureFormat).

This produces a less confusing error message by not mentioning the
aspect it is not relevant.
2025-08-29 10:03:35 +00:00
Lucas Abel
cd14b194a4
[egl] get rid of unwrap where possible (#8024)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2025-08-28 21:59:54 +00:00
Andy Leiserson
4a7b6abb19 Add F16_IN_F32 downlevel flag for pack/unpack/quantize f16 (#8130)
Although the operation of these functions is defined in terms of f16
semantics, the input/output types are not f16, and they are generally
available even when native `f16` support is not. But in at least one
case, they are only available with `f16` support, so add a new downlevel
flag that is cleared when these functions are not available.

Add some infrastructure to simplify testing of missing
capabilities/extensions, and add tests for a few more kinds of f16
usage.

Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2025-08-28 13:58:36 -07:00
Connor Fitzgerald
2ff46cd7cd
Remove MULTI_DRAW_INDIRECT feature (#8162) 2025-08-28 12:00:14 -04:00
Connor Fitzgerald
97ba77d668
We're just lowercase bro (#8160) 2025-08-28 11:09:07 -04:00
Kevin Reid
1c8d769b67
[naga] Introduce KeywordSet and CaseInsensitiveKeywordSet. (#8136) 2025-08-27 23:42:02 -04:00
Erich Gubler
dd73743e78
fix(wgsl-in): accept trailing comma in @blend_src(…) attr. (#8137) 2025-08-24 11:37:19 -07:00
Vecvec
c4a834e4f9
Make the compacted hal acceleration structure inherit a label from the base BLAS. #8103 2025-08-24 09:11:13 +00:00
cryvosh
4b5e38ab49
[naga spv-out] Add f16 io polyfill (#7884) 2025-08-21 10:50:32 +02:00
Andy Leiserson
e7a99be058
[deno] Fix some problems in the handling of device limits (#8085)
* Correct error type when a requested limit is too high
* Clamp requested limits to the WebGPU defaults

Fixes #8084
2025-08-20 14:58:56 -07:00
Magnus
17a17f716a
Initial precompiled shaders implementation (#7834)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-08-20 16:20:59 -04:00
Jamie Nicol
eb9b2e9c9b
Add changelog entry for external texture support (#8123) 2025-08-20 11:35:47 -04:00
Vecvec
54be6a2b5b
Fix empty ifs causing errors on spirv 1.6 (#7883) 2025-08-13 15:27:51 +00: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
Kevin Reid
ea8315e28e Change uncaptured error handler pointer type from Box to Arc.
This will be necessary for the next change.
2025-08-13 16:26:46 +01:00
Kevin Reid
2e8a600e35 Add Sync bound to uncaptured error handler.
It makes sense for a function to be `FnMut + Send`, or `Fn + Send + Sync`,
but not `Fn + Send` because that is overly restrictive for the caller and
the callee.
2025-08-13 16:26:46 +01:00
Andy Leiserson
0cc8c11afe
Escape control chars in source when printing diagnostics (#8049) 2025-08-11 12:16:46 -07:00
Erich Gubler
f9df2b5442 docs(CHANGELOG): move #7345's entry to Unreleased 2025-08-11 09:35:02 -04:00
Erich Gubler
d17228fda8 docs(CHANGELOG): port 26.0.{3,4} release notes 2025-08-11 09:35:02 -04:00
Erich Gubler
02636cd940 style(CHANGELOG): trim extra whitespace 2025-08-11 09:35:02 -04:00
Marc Pabst
e7cdfc436a
Allow disabling waiting for latency waitable object (#7400) 2025-08-10 10:01:25 +00:00
Andy Leiserson
24a05fefdf
Update CHANGELOG (#8050) 2025-08-07 18:01:45 -07:00
Erich Gubler
b5385225ab
fix(core): validate effective buf. binding size is aligned to 4 (#8041)
The WebGPU spec. `createBindGroup` [states][spec-ref] (emphasis mine):

> Device timeline initialization steps:
>
> …
>
> 2. If any of the following conditions are unsatisfied generate a
>    validation error, invalidate _bindGroup_ and return.
>
>    …
>
>    For each `GPUBindGroupEntry` _bindingDescriptor_ in
>    _descriptor_.`entries`:
>
>    - …
>
>    - If the defined binding member for _layoutBinding_ is:
>
>      - …
>
>      - `buffer`
>
>        - …
>
>        - If _layoutBinding_.`buffer`.`type` is
>
>          - …
>
>          - `"storage"` or `"read-only-storage"`
>
>            - …
>
>            - effective buffer binding size(_bufferBinding_) is a multiple of 4.

[spec-ref]: https://www.w3.org/TR/webgpu/#dom-gpudevice-createbindgroup

We were not implementing this check of effective buffer binding size.
Check that it's a multiple of 4, including
`webgpu:api,validation,createBindGroup:buffer,effective_buffer_binding_size:*`
that this is now implemented as intended.
2025-08-06 16:19:08 +02:00
atlv
7cb642eba7
fix STATUS_HEAP_CORRUPTION crash in create_sampler (#8043)
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2025-08-05 14:43:54 +00: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
SupaMaggie70Incorporated
074c0e7191
Add mesh shading api to wgpu & wgpu-core (#7345) 2025-07-24 20:58:56 -04:00
Connor Fitzgerald
4bd0f751f8
Backport changelog from v26.0.2 (#7999) 2025-07-24 17:52:11 -04:00
Andy Leiserson
942e59eabc
[naga] Enforce a maximum size for any type (#7950)
* [naga] Enforce a maximum size for any type

Fixes #4339
Fixes #7383

* Doc fix and changelog entry
2025-07-21 13:52:50 +02:00
Connor Fitzgerald
085eaa60e8
Forward port v26.0.1 changelog (#7921) 2025-07-10 18:42:49 -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
Erich Gubler
166c2ea2aa
fix(core): check query set index before other validation (#7908) 2025-07-10 19:04:37 +00:00
Kevin Reid
da6ccd5516 Fix undeclared base in profiling scopes.
This would cause compilation to fail if profiling was enabled.
2025-07-10 14:42:08 -04:00
Connor Fitzgerald
8ee66bde9f Update changelog for v26 2025-07-09 20:38:11 -04:00
Connor Fitzgerald
a851eba5f6
Add TextureView::texture (#7907) 2025-07-09 19:53:55 -04:00
Connor Fitzgerald
4f156357b8 Switch as_hal to return a guard 2025-07-09 18:08:11 -04:00
Drew Crawford
92cda27b41
Implement on_submitted_work_done (#7864) 2025-07-01 13:21:27 -04:00
Erich Gubler
c7e6170fd0 refactor(deno): use WebGpuError for error classification 2025-06-30 10:58:56 -04:00
Erich Gubler
cc0f4ac4bf refactor(wgpu)!: use WebGpuError for error classification 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
Erich Gubler
c8752e5118 feat(types): add error::{ErrorType, WebGpuError} APIs 2025-06-30 10:58:56 -04:00
Andy Leiserson
41badaedfb Update tests and changelog for deferred error reporting 2025-06-26 15:39:53 -07:00
Vecvec
0d61648eeb
Allow enabling additional vulkan extensions in Adapter::open and Instance::init (#7829)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-06-26 20:39:41 +00:00
Simon Hausmann
208fe4c23d
Expose the DxgiAdapter in the Hal adapter (#7852) 2025-06-26 16:34:59 -04:00
Andreas Reich
12808193fe
Fix warnings for unrecognized Vulkan present mode (#7850) 2025-06-26 09:33:20 -04:00
Mendy Berger
4c08c37a46
Expose raw_factory (#7827)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-06-25 19:43:23 +00:00
Erich Gubler
df272d3cfc
chore(CHANGELOG): merge Unreleased/New features/Naga sections (#7802) 2025-06-25 15:02:56 -04:00