955 Commits

Author SHA1 Message Date
Magnus
05cc6dca82
[hal/dx12] Mesh Shaders (#8110)
* Features and draw commands added

* Tried to implement the pipeline creation (completely untested)

* Fixed clippy issues

* Fixed something I think

* A little bit of work on the mesh shader example (currently doesn't work on dx12)

* Reached a new kind of error state

* Fixed an alignment issue

* DirectX 12 mesh shaders working :party:

* Removed stupid change and updated changelog

* Fixed typo

* Added backends option to example framework

* Removed silly no write fragment shader from tests to see if anything breaks

* Tried to make mesh shader tests run elsewhere too

* Removed printlns and checked that dx12 mesh shader tests run

* Documented very strange issue

* I'm so lost

* Fixed stupid typos

* Fixed all issues

* Removed unnecessary example stuff, updated tests

* Updated typos.toml

* Updated limits

* Apply suggestion from @cwfitzgerald

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

* Apply suggestion from @cwfitzgerald

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

* Removed supported backends, made example & tests always pass the filename to shader compilers

* Removed excessive bools in test params

* Added new tests to the list

* I'm a sinner for this one (unused import)

* Replaced random stuff with test params hashing

* Updated typos.toml

* Updated -Fo typo thing

* Actually fixed typo issue this time

* Update CHANGELOG.md

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

* Update tests/tests/wgpu-gpu/mesh_shader/mod.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update wgpu-hal/src/dx12/mod.rs

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

* Addressed comments

* Lmao

---------

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-25 03:24:56 +00:00
Andy Leiserson
1f10d0ce8a
[naga] Don't report shader errors as their own source (#8258) 2025-09-24 22:42:24 -04:00
EriKWDev
3efd640178
naga: Correct spelling in wgsl parsing rg11b10float -> rg11b10ufloat (#8219) 2025-09-21 10:41:17 +00:00
Matthias Reitinger
b55c24cf27
[naga wgsl-in] Allow trailing comma in switch cases (#8165) 2025-09-16 07:58:23 -04:00
Andy Leiserson
f4ea8642a5
docs(CHANGELOG): Update pull request reference (#8208) 2025-09-11 00:52:02 -04:00
Andy Leiserson
d31d944ed5
Clarify the effect of the SUBGROUP features and capabilities (#8203) 2025-09-10 20:53:56 -04:00
Night_Hunter
3902b0c11c
Add support for builtin DComp swapchains (#7550)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Marijn Suijten <marijns95@gmail.com>
2025-09-11 00:19:42 +00:00
Connor Fitzgerald
fb28da16c1 [wgpu] add convience functions for deferring mapping/callbacks
Co-authored-by: Kevin Reid <kpreid@switchb.org>
2025-09-07 09:42:57 +02:00
Connor Fitzgerald
832609959d
Convert QueueWriteBufferView to be lifetime-less (#8161) 2025-09-07 07:34:06 +00:00
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