mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-25 17:01:15 +01:00
Update changelog
This commit is contained in:
1 file changed
+67
-27
+67
-27
@@ -41,19 +41,21 @@ Bottom level categories:
|
||||
|
||||
## Unreleased
|
||||
|
||||
## v28.0.0 (2025-12-17)
|
||||
|
||||
### Major Changes
|
||||
|
||||
#### Added support for mesh shaders
|
||||
#### Mesh Shaders
|
||||
|
||||
This has been a long time coming. See [the tracking issue](https://github.com/gfx-rs/wgpu/issues/7197) for more information.
|
||||
They are now fully supported on Vulkan, and supported on Metal and DX12 with passthrough shaders. WGSL parsing and rewriting
|
||||
is supported, meaning they can be used through WESL or naga_oil.
|
||||
|
||||
Mesh shader pipelines replace standard vertex shader pipelines and allow new ways to render meshes. They form the core of
|
||||
some rendering engines, including Unreal Engine's nanite. This is because they are ideal for meshlet rendering, a form
|
||||
of rendering where small groups of triangles are handled together, for culling and for rendering.
|
||||
Mesh shader pipelines replace the standard vertex shader pipelines and allow new ways to render meshes.
|
||||
They are ideal for meshlet rendering, a form of rendering where small groups of triangles are handled together,
|
||||
for both culling and rendering.
|
||||
|
||||
The core idea is that compute-like shaders will generate primitives directly that will then be passed to the rasterizer, rather
|
||||
They are compute-like shaders, and generate primitives which are passed directly to the rasterizer, rather
|
||||
than having a list of vertices generated individually and then using a static index buffer. This means that certain computations
|
||||
on nearby groups of triangles can be done together, the relationship between vertices and primitives is more programmable, and
|
||||
you can even pass non-interpolated per-primitive data to the fragment shader, independent of vertices.
|
||||
@@ -61,8 +63,8 @@ you can even pass non-interpolated per-primitive data to the fragment shader, in
|
||||
Mesh shaders are very versatile, and are powerful enough to replace vertex shaders, tesselation shaders, and geometry shaders
|
||||
on their own or with task shaders.
|
||||
|
||||
A full example of mesh shaders in use can be seen in the `mesh_shader` example. Below is a small snippet of shader code
|
||||
demonstrating their usage:
|
||||
A full example of mesh shaders in use can be seen in the `mesh_shader` example. For the full specification of mesh shaders in wgpu, go to [docs/api-specs/mesh_shading.md](docs/api-specs/mesh_shading.md). Below is a small snippet of shader code demonstrating their usage:
|
||||
|
||||
```wgsl
|
||||
@task
|
||||
@payload(taskPayload)
|
||||
@@ -106,7 +108,38 @@ fn ms_main(@builtin(local_invocation_index) index: u32, @builtin(global_invocati
|
||||
}
|
||||
```
|
||||
|
||||
See other changes in this changelog for more information.
|
||||
##### Thanks
|
||||
|
||||
This was a monumental effort from many different people, but it was championed by @inner-daemons, without whom it would not have happened.
|
||||
Thank you @cwfitzgerald for doing the bulk of the code review. Finally thank you @ColinTimBarndt for coordinating the testing effort.
|
||||
|
||||
Reviewers:
|
||||
- @cwfitzgerald
|
||||
- @jimblandy
|
||||
- @ErichDonGubler
|
||||
|
||||
`wgpu` Contributions:
|
||||
- Metal implementation in wgpu-hal. By @inner-daemons in [#8139](https://github.com/gfx-rs/wgpu/pull/8139).
|
||||
- DX12 implementation in wgpu-hal. By @inner-daemons in [#8110](https://github.com/gfx-rs/wgpu/pull/8110).
|
||||
- Vulkan implementation in wgpu-hal. By @inner-daemons in [#7089](https://github.com/gfx-rs/wgpu/pull/7089).
|
||||
- wgpu/wgpu-core implementation. By @inner-daemons in [#7345](https://github.com/gfx-rs/wgpu/pull/7345).
|
||||
- New mesh shader limits and validation. By @inner-daemons in [#8507](https://github.com/gfx-rs/wgpu/pull/8507).
|
||||
|
||||
`naga` Contributions:
|
||||
- Naga IR implementation. By @inner-daemons in [#8104](https://github.com/gfx-rs/wgpu/pull/8104).
|
||||
- `wgsl-in` implementation in naga. By @inner-daemons in [#8370](https://github.com/gfx-rs/wgpu/pull/8370).
|
||||
- `spv-out` implementation in naga. By @inner-daemons in [#8456](https://github.com/gfx-rs/wgpu/pull/8456).
|
||||
- `wgsl-out` implementation in naga. By @Slightlyclueless in [#8481](https://github.com/gfx-rs/wgpu/pull/8481).
|
||||
- Allow barriers in mesh/task shaders. By @inner-daemons in [#8749](https://github.com/gfx-rs/wgpu/pull/8749)
|
||||
|
||||
Testing Assistance:
|
||||
- @ColinTimBarndt
|
||||
- @AdamK2003
|
||||
- @Mhowser
|
||||
- @9291Sam
|
||||
- 3 more testers who wished to remain anonymous.
|
||||
|
||||
Thank you to everyone to made this happen!
|
||||
|
||||
#### Switch from `gpu-alloc` to `gpu-allocator` in the `vulkan` backend
|
||||
|
||||
@@ -116,6 +149,8 @@ the allocator the same way in those two backends converging their behavior.
|
||||
This also brings the `Device::generate_allocator_report` feature to
|
||||
the vulkan backend.
|
||||
|
||||
By @DeltaEvo in [#8158](https://github.com/gfx-rs/wgpu/pull/8158).
|
||||
|
||||
#### `wgpu::Instance::enumerate_adapters` is now `async` & available on WebGPU
|
||||
|
||||
BREAKING CHANGE: `enumerate_adapters` is now `async`:
|
||||
@@ -125,15 +160,13 @@ BREAKING CHANGE: `enumerate_adapters` is now `async`:
|
||||
+ pub fn enumerate_adapters(&self, backends: Backends) -> impl Future<Output = Vec<Adapter>> {
|
||||
```
|
||||
|
||||
This yields ([kek]) two benefits:
|
||||
This yields two benefits:
|
||||
|
||||
- This method is now implemented on non-native using the standard `Adapter::request_adapter(…)`, making `enumerate_adapters` a portable surface. This was previously a nontrivial pain point when an application wanted to do some of its own filtering of adapters.
|
||||
- This method can now be implemented in custom backends.
|
||||
|
||||
By @R-Cramer4 in [#8230](https://github.com/gfx-rs/wgpu/pull/8230)
|
||||
|
||||
[kek]: https://web.archive.org/web/20250923122958/https://knowyourmeme.com/memes/kek
|
||||
|
||||
#### New `LoadOp::DontCare`
|
||||
|
||||
In the case where a renderpass unconditionally writes to all pixels in the rendertarget,
|
||||
@@ -164,17 +197,21 @@ SamplerDescriptor {
|
||||
}
|
||||
```
|
||||
|
||||
By @sagudev in [#8314](https://github.com/gfx-rs/wgpu/pull/8314).
|
||||
|
||||
#### Multiview on all major platforms and support for multiview bitmasks
|
||||
|
||||
Multiview is a feature that allows rendering the same content to multiple layers of a texture. This is useful primarily in VR where you wish to
|
||||
display almost identical content to 2 views, just with a different perspective. Instead of using 2 draw calls or 2 instances for each object, you
|
||||
Multiview is a feature that allows rendering the same content to multiple layers of a texture.
|
||||
This is useful primarily in VR where you wish to display almost identical content to 2 views,
|
||||
just with a different perspective. Instead of using 2 draw calls or 2 instances for each object, you
|
||||
can use this feature.
|
||||
|
||||
Multiview is also called view instancing in DX12 land or vertex amplification in Metal land.
|
||||
Multiview is also called view instancing in DX12 or vertex amplification in Metal.
|
||||
|
||||
Multiview has been reworked, adding support for Metal and DX12, and adding testing and validation to wgpu itself.
|
||||
This change also introduces a view bitmask, a new field in `RenderPassDescriptor` that allows a render pass to render to multiple non-adjacent layers
|
||||
when using the `SELECTIVE_MULTIVIEW` feature. Note that this also influences apps that don't use multiview, as they have to set this mask to `None`.
|
||||
This change also introduces a view bitmask, a new field in `RenderPassDescriptor` that allows a render pass to render
|
||||
to multiple non-adjacent layers when using the `SELECTIVE_MULTIVIEW` feature. If you don't use multi-view,
|
||||
you can set this field to none.
|
||||
|
||||
```diff
|
||||
- wgpu::RenderPassDescriptor {
|
||||
@@ -196,7 +233,7 @@ when using the `SELECTIVE_MULTIVIEW` feature. Note that this also influences app
|
||||
|
||||
One other breaking change worth noting is that in WGSL `@builtin(view_index)` now requires a type of `u32`, where previously it required `i32`.
|
||||
|
||||
By @SupaMaggie70Incorporated in [#8206](https://github.com/gfx-rs/wgpu/pull/8206).
|
||||
By @inner-daemons in [#8206](https://github.com/gfx-rs/wgpu/pull/8206).
|
||||
|
||||
#### Error scopes now use guards and are thread-local.
|
||||
|
||||
@@ -253,6 +290,16 @@ to all shader stages that use immediate data.
|
||||
+ rpass.set_immediates(0, bytes);
|
||||
```
|
||||
|
||||
Third, immediates are now declared with the `immediate` address space instead of
|
||||
the `push_constant` address space. Due to a [known issue on DX12](https://github.com/gfx-rs/wgpu/issues/5683)
|
||||
it is advised to always use a structure for your immediates until that issue
|
||||
is fixed.
|
||||
|
||||
```diff
|
||||
- var<push_constant> my_pc: MyPushConstant;
|
||||
+ var<immediate> my_imm: MyImmediate;
|
||||
```
|
||||
|
||||
Finally, our implementation currently still zero-initializes the immediate data
|
||||
range you declared in the pipeline layout. This is not spec compliant and failing
|
||||
to populate immediate "slots" that are used in the shader will be a validation error
|
||||
@@ -306,11 +353,10 @@ By @cwfitzgerald in [#8609](https://github.com/gfx-rs/wgpu/pull/8609).
|
||||
|
||||
#### Metal
|
||||
|
||||
- Add support for mesh shaders. By @SupaMaggie70Incorporated in [#8139](https://github.com/gfx-rs/wgpu/pull/8139)
|
||||
- Expose render layer. By @xiaopengli89 in [#8707](https://github.com/gfx-rs/wgpu/pull/8707)
|
||||
- `MTLDevice` is thread-safe. By @uael in [#8168](https://github.com/gfx-rs/wgpu/pull/8168)
|
||||
|
||||
#### Naga
|
||||
#### naga
|
||||
|
||||
- Prevent UB with invalid ray query calls on spirv. By @Vecvec in [#8390](https://github.com/gfx-rs/wgpu/pull/8390).
|
||||
- Update the set of binding_array capabilities. In most cases, they are set automatically from `wgpu` features, and this change should not be user-visible. By @andyleiserson in [#8671](https://github.com/gfx-rs/wgpu/pull/8671).
|
||||
@@ -318,11 +364,6 @@ By @cwfitzgerald in [#8609](https://github.com/gfx-rs/wgpu/pull/8609).
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
#### naga
|
||||
|
||||
- Fix a bug that resulted in the Metal error `program scope variable must reside in constant address space` in some cases. By @teoxoy in [#8311](https://github.com/gfx-rs/wgpu/pull/8311).
|
||||
- Handle `rayQueryTerminate` in spv-out instead of ignoring it. By @Vecvec in [#8581](https://github.com/gfx-rs/wgpu/pull/8581).
|
||||
|
||||
#### General
|
||||
|
||||
- Fixed a bug where mapping sub-ranges of a buffer on web would fail with `OperationError: GPUBuffer.getMappedRange: GetMappedRange range extends beyond buffer's mapped range`. By @ryankaplan in [#8349](https://github.com/gfx-rs/wgpu/pull/8349)
|
||||
@@ -334,13 +375,13 @@ By @cwfitzgerald in [#8609](https://github.com/gfx-rs/wgpu/pull/8609).
|
||||
- The texture subresources used by the color attachments of a render pass are no longer allowed to overlap when accessed via different texture views. By @andyleiserson in [#8402](https://github.com/gfx-rs/wgpu/pull/8402).
|
||||
- The `STORAGE_READ_ONLY` texture usage is now permitted to coexist with other read-only usages. By @andyleiserson in [#8490](https://github.com/gfx-rs/wgpu/pull/8490).
|
||||
- Validate that buffers are unmapped in `write_buffer` calls. By @ErichDonGubler in [#8454](https://github.com/gfx-rs/wgpu/pull/8454).
|
||||
- Add WGSL parsing for mesh shaders. By @inner-daemons in [#8370](https://github.com/gfx-rs/wgpu/pull/8370).
|
||||
- Add WGSL writing for mesh shaders. By @Slightlyclueless in [#8481](https://github.com/gfx-rs/wgpu/pull/8481).
|
||||
- Shorten critical section inside present such that the snatch write lock is no longer held during present, preventing other work happening on other threads. By @cwfitzgerald in [#8608](https://github.com/gfx-rs/wgpu/pull/8608).
|
||||
|
||||
#### naga
|
||||
|
||||
- The `||` and `&&` operators now "short circuit", i.e., do not evaluate the RHS if the result can be determined from just the LHS. By @andyleiserson in [#7339](https://github.com/gfx-rs/wgpu/pull/7339).
|
||||
- Fix a bug that resulted in the Metal error `program scope variable must reside in constant address space` in some cases. By @teoxoy in [#8311](https://github.com/gfx-rs/wgpu/pull/8311).
|
||||
- Handle `rayQueryTerminate` in spv-out instead of ignoring it. By @Vecvec in [#8581](https://github.com/gfx-rs/wgpu/pull/8581).
|
||||
|
||||
#### DX12
|
||||
|
||||
@@ -350,7 +391,6 @@ By @cwfitzgerald in [#8609](https://github.com/gfx-rs/wgpu/pull/8609).
|
||||
#### Vulkan
|
||||
|
||||
- Fixed a validation error regarding atomic memory semantics. By @atlv24 in [#8391](https://github.com/gfx-rs/wgpu/pull/8391).
|
||||
- Add mesh shader writer support, allowing WGSL shaders to be used on the vulkan backend. Only works on NVIDIA and Intel GPUs. By @inner-daemons in [#8456](https://github.com/gfx-rs/wgpu/pull/8456).
|
||||
|
||||
#### Metal
|
||||
- Fixed a variety of feature detection related bugs. By @inner-daemons in [#8439](https://github.com/gfx-rs/wgpu/pull/8439).
|
||||
|
||||
Reference in new issue
Block a user