Commit Graph
1484 Commits
Author SHA1 Message Date
Teodor Tanasoaia e114d2f0a7 Add support for gaps in bind group layouts & update relevant validation (#9034)
* [wgpu-core] add support for optional BG & BGL entries

* [wgpu] allow gaps in bind group layouts

And allow unbinding in the web backend.

* adapt tests

* add changelog entry

* [wgpu] remove generic from `PipelineLayoutDescriptor`
2026-02-25 19:47:36 +01:00
Andy Leiserson b09a919c6a DepthStencilState validation fixes (#8840)
* Make `depth_compare` and `depth_write_enabled` optional

These fields are optional in the WebGPU API. Having them optional in the
wgpu API as well keeps validation logic centralized in wgpu-core.

Fixes #8830

* Remove `DepthStencilStateIdl`
2026-02-25 14:59:48 +01:00
Andy LeisersonandErich Gubler 3dfa9af0db Enable FLOAT32_BLENDABLE on Metal, in Deno, and separate from filtering (#9032)
---------
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2026-02-24 14:52:34 -08:00
Luo Zhihao 6432094c9e GLES: Set DownlevelFlags::CUBE_ARRAY_TEXTURES correctly (#9088) 2026-02-22 10:01:57 +01:00
Erich Gubler 7705c84485 fix(d12): fix startup crash for shader models 6.8, 6.9 (#9083) 2026-02-21 04:37:22 +00:00
Inner Daemons c7f3db8bf1 Remove dispatch2 dependency (#9048) 2026-02-18 16:55:20 -08:00
Inner Daemons 8f50bb9d98 Make passthrough shaders non-experimental (#9054)
* Refactored passthrough shaders

* Added a changelog entry
2026-02-18 12:29:50 -05:00
Alexander Meißner 05861da365 [hal metal] ray tracing acceleration structures (#8071)
* Fixes index_buffer label in ray_traced_triangle example.

* Fixes min_push_constant_size in ray_shadows example.

* Ensures there always is Some() buffer reference, even for get_acceleration_structure_build_sizes().

* Updates CHANGELOG.

* Adds feature detection.

* Adds Capabilities Limits.

* Adds necessary objc2-metal features in Cargo.toml

* Sets raw_tlas_instance_size.

* Sets ray_tracing_scratch_buffer_alignment.

* Adds conv::map_index_format().

* Adds conv::map_acceleration_structure_descriptor().

* Implements AccelerationStructure.

* Implements resource binding.

squash with "Implements resource binding."

* Adds CommandState::acceleration_structure_builder.

* Implements CommandEncoder::copy_acceleration_structure_to_acceleration_structure().

* Implements CommandEncoder::build_acceleration_structures().

* Implements CommandEncoder::place_acceleration_structure_barrier().

* Implements CommandEncoder::read_acceleration_structure_compact_size().

* Implements Device::get_acceleration_structure_build_sizes().

* Implements Device::get_acceleration_structure_device_address().

* Implements Device::create_acceleration_structure().

* Implements Device::destroy_acceleration_structure().

* Implements Device::tlas_instance_to_bytes().

* Adds CommandEncoder::set_acceleration_structure_dependencies().

* Review feedback
2026-02-19 06:21:11 +13:00
Connor Fitzgerald 26c5618d83 Fix CRLF in dxgi.rs (#9067) 2026-02-17 09:22:14 -05:00
Inner Daemons 43a88474f4 Fixed clippy lint in CI (#9050) 2026-02-13 16:21:31 -08:00
Inner Daemons 6bca1014b2 Various SPIR-V fixes for mesh shaders (#8756)
* Initial commit adding miscellaneous changes from msl-write and hlsl-write

* Same as previous commit

* Fixed divergence issue

* Removed some unnecessary barriers

* Zero init workgroup memory

* Added limits validation

* Added changelog

* Handled overflow, removed todo

* Lets see if this fixes llvmpipe

* Also this commit fixes llvmpipe maybe

* Unfortunate but not too unexpected at this point

* Updated feature to say to use ShaderRuntimeChecks::unchecked()

* Updated snapshots and took some changes from the hlsl writer

* Snapshots

* 2 quick tweaks

* Updated framework with suggestions by Connor in #8752

* Moved the task runtime limits into naga::back

* Fixed soem stuff

* Fixed checks: >= into >

* Cant believe I forgot this

* Removed code using u64 to check stuff

* Removed thing with limiting it to 2<<21

* Some more work

* Fixed compiles

* Added new field to spv options

* Updated some stuff to pass around the task runtime limits in more ways

* New PR started

* Did another quick fix

* Another quick fix

* Added changelog entry

* Added some explanation docs

* Fixed a warning

* Fixed shader

* Fixed some things & added docs

* Reverted dxc thing

* Fixed thing

* Refactored to TaskDispatchLimits

* Fixed compile error
2026-02-12 14:47:42 -05:00
Inner Daemons 6503562948 Add a DX12 backend option to force a certain shader model (#8984) 2026-02-11 18:14:30 -05:00
Inner Daemons ed12b74168 Changed wgpu to default to static dxc when the feature is enabled (#8882) 2026-02-11 22:41:45 +00:00
Inner Daemons 7609ed99e5 Add draw_id builtin (#8883) 2026-02-11 20:47:29 +00:00
09f49b6f97 feat(gles): Add GlDebugFns option to disable OpenGL debug functions (#8931)
Co-authored-by: mobile-pusher-bot[bot] <127349242+mobile-pusher-bot[bot]@users.noreply.github.com>
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2026-02-11 17:05:32 +01:00
David Lenaerts a7ed7f4f12 Cause shader recompilation when changing shader constants in GLES (#8291) 2026-02-11 07:47:11 +00:00
Connor Fitzgerald 04746e747e Implement 3 part MSRV policy (#8999) 2026-02-08 17:04:36 -05:00
Andy Leiserson 3b55cf9b8c fix(metal): Don't panic on OOM in create_buffer (#8994) 2026-02-03 19:42:31 -07:00
Mads Marquart a5116520b0 metal: Move API availability checks out of PrivateCapabilities
We always want to call newer methods if available, so there is no need
to store this in a variable if we can use the `available!` macro
directly at the usage site.
2026-02-02 17:08:14 -08:00
Mads Marquart 13a1da5df1 metal: Use objc2::available! macro
This is clearer than the check against `NSOperatingSystemVersion`, and
the `available!` allows being compiled away if the deployment target is
specified to be high enough.

The `available!` macro also allows checking against patch versions.
2026-02-02 17:08:14 -08:00
Erich Gubler a586d96be9 refactor(vulkan): use array iterator + all for tex. fmt. support queries (#8964) 2026-02-01 00:02:00 -05:00
Inner Daemons fab57513ec Add metallib passthrough (#8886) 2026-01-30 13:52:05 -05:00
Vecvec 8a37e0f56a [wgsl in and IR] naga ray tracing pipelines (#8570) 2026-01-29 14:18:56 -05:00
Timo KöstersandErich Gubler b93bab52bc feat: support blendable f32 textures on vulkan (#8963)
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2026-01-29 17:07:22 +00:00
Erich Gubler 487afd21e4 chore: update REPO_MSRV 1.92 → 1.93 2026-01-28 15:42:38 -05:00
Erich Gubler 9bc127f128 chore: update CORE_MSRV to 1.90 (#8943)
New cases for some Clippy lints pop up as part of this upgrade that
cannot be done before, listed below. Yuck!

- `clippy::manual_is_multiple_of`
- `clippy::missing_const_for_fn`
- `clippy::useless_nonzero_new_unchecked`
2026-01-27 19:37:10 -05:00
Mads Marquart 4104aa1320 Use normal objc2 naming scheme 2026-01-27 16:28:08 -08:00
Mads Marquart 80871cfc01 Use objc2-metal with metal naming scheme
To keep the diff smaller and easier to review, this uses a temporary
fork of `objc2-metal` and `objc2-quartz-core` whose methods use the
naming scheme of the `metal` crate.

One particular difficult part with this is that the `metal` crate has
several methods where the order of the arguments are swapped relative
to the corresponding Objective-C methods.

This includes most perilously the following, since these have both an
offset and an index argument, both of which are integers:
- `set_bytes`
- `set_vertex_bytes`
- `set_fragment_bytes`
- `set_buffer`
- `set_vertex_buffer`
- `set_fragment_buffer`
- `set_threadgroup_memory_length`

But also:
- `set_vertex_texture`
- `set_fragment_texture`
- `set_sampler_state`
- `set_vertex_sampler_state`
- `set_fragment_sampler_state`
2026-01-27 16:28:08 -08:00
Mads Marquart 8ffa34a9d4 [metal] Use raw-window-metal to do layer creation (#6210)
This removes the manual implementation introduced in 7b00140.
2026-01-26 12:45:03 -08:00
Teodor Tanasoaia 723cb5db0c [d3d12] fix possible crash on GPUs that only support SM5.1 (#8918) 2026-01-26 10:50:03 +01:00
Vecvec c97fe3e7c4 [HLSL] Make ray queries safer. (#8763) 2026-01-15 21:35:18 -05:00
atlvandConnor Fitzgerald 4a3526a745 Add per-vertex attribute support to vulkan, spir-v and wgsl. (#8821)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2026-01-16 01:04:06 +00:00
Andy Leiserson 90197afd54 Round max_vertex_buffer_array_stride down to a multiple of 4 (#8847)
Fixes #8846

Note that the CTS test in the issue is already enabled
(`webgpu:api,operation,vertex_state,correctness:non_zero_array_stride_and_attribute_offset:*`).
It seems the failure only appears on specific hardware/drivers.
2026-01-15 11:28:18 -08:00
Teodor Tanasoaia 0cd51d20f3 [d3d12] fix panics in adapter creation (#8845) 2026-01-08 16:50:02 -05:00
Luo Zhihao 4b3bf0740a Fix Android crash by setting waitAll to true in vkWaitForFences (#8769) 2025-12-29 00:29:21 -05:00
Erich Gubler 6948a01d8c fix(core): remove max_inter_stage_shader_components validation 2025-12-23 16:09:17 -05:00
Erich Gubler 0fbfbf8aa4 feat(core)!: add Limits::max_inter_stage_shader_variables 2025-12-23 16:09:17 -05:00
Marijn Suijten 234ec66152 Allow optional RawDisplayHandle in InstanceDescriptor (#8012) 2025-12-23 14:53:04 -05:00
Dzmitry Malyshau bff1f6d095 (Naga) Cooperative Matrix Support (#8251) 2025-12-22 13:14:57 -05:00
Opstic 42582cdb1b Re-add support for memoryless storage on A7 (#8725) 2025-12-19 13:20:44 -05:00
Connor Fitzgerald daf69de67a Bump MSRV to 1.92 for real (#8723) 2025-12-17 17:12:23 +01:00
952d653835 New mesh shader limits (#8507)
* Initial commit

* Other initial changes

* Updated shader snapshots

* Added new HLSL limitation

* Moved error to global variable error

* Added docs to per_primitive

* Added a little bit more docs here and there in IR

* Adding validation to ensure that task shaders have a task payload

* Updated spec to reflect the change to payload variables

* Updated the mesh shading spec because it was goofy

* some doc tweaks

* Tried to clarify docs a little

* Tried to update spec

* Removed a warning

* Addressed comment about docs mistake

* Review in progress

- Extensive revisions to `docs/api-specs/mesh_shading.md`.

- Doc comments.

- Ensure `Module` stays at the bottom of `ir/mod.rs`.

- Avoid a clone.

- Rename some arguments to be more specific.

- Minor readability tweaks.

* mesh_shading.md: more tweaks

* Ran cargo fmt

* Small tweaks

* [naga] Move definition of `ShaderStage::compute_like` to `proc`.

Move the definition of `naga::ShaderStage::compute_like` from
`naga::ir` into `naga::proc`. We generally want ot keep methods out of
`naga::ir`, since the IR itself is complicated enough already.

* Replace TODO comment with followup issue.

* Update analyzer.rs

Co-authored-by: Jim Blandy <jimb@red-bean.com>

* Removed stuff in accordance with Jim's recommendation

* minor changes for readability

* Pull mesh shader output type validation out into its own function.

* doc fixes

* remove duplicated task payload validation

* Quick little changes

* Another quick fix

* Quick fix

* Removed unnecessary TODO statement

* A

* Tried to be more expressive

* Made functions only work in mesh shader entry points

* Various validation fix attempts

* Undid capabilities resize

* WGSL PR is up :)

* Update naga/src/ir/mod.rs

Co-authored-by: Erich Gubler <erichdongubler@gmail.com>

* Update naga/src/front/wgsl/error.rs

Co-authored-by: Erich Gubler <erichdongubler@gmail.com>

* Update naga/src/ir/mod.rs

Co-authored-by: Erich Gubler <erichdongubler@gmail.com>

* Other Erich suggestion

* Updated docs & validation for some builtins

* Added some docs & removed contentious "// TODO"

* Fixed bad validation, formatted mesh shader wgsl

* Rewrote the IR and parser significantly

* Improved validation slightly, remvoed obselete crap, fixed bug in compaction, made clippy happy

* Added changelog entry

* Made parser respect enable extension

* Updated mesh shader spec

* Cleaned up the mesh shader analyzer function

* Updated changelog

* Updated validation from spv-write

* Slight tweaks

* Added capabilitiy thing blah blah blah

* Fixed compaction & clean stuff up

* Fixed compaction and such pt 2

* Paved the way for primitive-index stuff

* Little bit of cleanup

* Added new features/capabilities for point primitives and added snapshots for stuff

* Updated spec to rename something

* Updated some limits stuff

* Made some improvements

* Fixed doctests & webgpu stuff

* Fixed experimental features stuff

* A little more scaffolding

* Added some initial validation

* Added per primitive validation

* Improved per primitive validation

* Added some more validation

* Fixed primitive index validation

* Updated the spec

* Updated comments on some limits

* Made some fixes

* Fixed new validation rule for task payload size

* Update wgpu-core/src/validation.rs

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

* Update wgpu-core/src/validation.rs

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

* A small tweak to mesh shader recommended minimums

* Addressed 2 comments

* A few more comments addressed with limits

* Addressed more comments

* Update wgpu-core/src/validation.rs

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

* Split up error

* Addressed another comment by changing workgroup size validation

* Final comment addressed

* Update wgpu-info/src/human.rs

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

* Update wgpu-core/src/validation.rs

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

* Update wgpu-info/src/human.rs

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

* Fixed compilation and added some new test functions

---------

Co-authored-by: SupaMaggie70Incorporated <85136135+SupaMaggie70Incorporated@users.noreply.github.com>
Co-authored-by: Jim Blandy <jimb@red-bean.com>
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-17 05:13:27 +00:00
Vecvec f1b79b1c30 Correct alignment if a buffer is an acceleration structure scratch buffer (#8745) 2025-12-17 00:02:38 -05:00
Teodor Tanasoaia 5c76751104 [d3d12] add support for optional adapter telemetry (#8576) 2025-12-16 12:34:29 -05:00
Connor Fitzgerald e52e8336b0 Bring immediate api in line with spec (#8724) 2025-12-16 13:13:09 +01:00
Connor Fitzgerald ea792d30fe Properly detect timestamp query feature on vulkan 2025-12-16 12:54:27 +01:00
Luo Zhihao bec772bdbd hal/vulkan: Fix multi draw indirect emulating and respect maxDrawIndirectCount (#8665) 2025-12-16 00:31:03 -05:00
Andy Leiserson 4a91c7fc6c Ensure the limit for storage binding size honors alignment (#8719) 2025-12-15 12:42:17 -05:00
Lucas Abel 81184f45b4 [metal] MTLDevice is thread-safe (#8168) 2025-12-15 17:03:31 +00:00
Inner Daemons cc005da1e1 Fix metal feature detection (#8439) 2025-12-12 15:08:38 -05:00