Commit Graph
868 Commits
Author SHA1 Message Date
Luo ZhihaoandErich Gubler a7e0298dc5 Validate LoadOp and StoreOp are None for attachments without corresponding depth or stencil aspect (#9567)
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2026-05-29 11:28:50 -04:00
Andy Leiserson d1e15bc3d3 refactor(core): Rename used_*_ranges to *_init_actions 2026-05-25 10:48:20 +02:00
Andy Leiserson 61e76ee746 fix(core): Use more checked arithmetic, part 2b (#9425) 2026-04-16 14:27:01 +02:00
teoxoy c9c7359f5b deduplicate vertex buffer validation in is_ready 2026-04-14 17:20:15 -07:00
teoxoy a1b646243d converge on a single VertexState impl for both render passes and
render bundles

- render passes now defer setting vertex buffers to the start of a draw
  command (same as bundles)
- render bundles now cache vertex/instance limit calculations when
  setting the pipeline or when setting a vertex buffer (same as passes)
2026-04-14 17:20:15 -07:00
teoxoy a9a641c82a remove PipelineState from bundle 2026-04-14 17:20:15 -07:00
teoxoy 4bbed4074c add max_bind_groups_plus_vertex_buffers limit 2026-04-14 17:20:15 -07:00
teoxoy 2060683c29 make vertex buffer slots optional 2026-04-14 17:20:15 -07:00
Erich Gubler 10ce22b2ea refactor!: subvert-rename dispatch* to dispatchWorkGroups* (#9362) 2026-04-11 20:58:22 +02:00
Teodor Tanasoaia f7b650d55c [wgpu-core] fix potential crash when device is not supplied to validate_render_bundle_encoder_descriptor (#9407) 2026-04-10 19:46:34 +00:00
Andy Leiserson 2640d038e2 fix(core): Allow calling RenderBundleEncoder::new without a device (#9404) 2026-04-10 12:57:11 +02:00
atlv e6e5f5288c Bring immediate in line with webgpu spec (#9280) 2026-04-09 22:36:02 +00:00
Andy Leiserson acc5855e1f fix(core): Use more checked arithmetic, part 2 (#9363) 2026-04-09 15:21:20 -06:00
Genna Wingert 2ac1faef05 feat(core): Add ComputePass::transition_resources (#9371) 2026-04-09 09:42:55 -04:00
Inner DaemonsandAndreas Reich b5bd5aed7d Mesh shaders MSL writer (#8739)
* Single squashed commit

* Updated changelog

* Fixed stupid changelog thing

* If I have to do this one more fucking time I'm gonna lose it

* Removed some pub(super)'s

* Thing

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2026-04-07 17:26:22 +00:00
Kristoffer Søholm 41bb9cbd25 Fix validation for bindings with different sizes (#9341) 2026-04-02 18:01:28 -07:00
Elabajaba e8afd9a906 fix debug assertion not covering both parts of the debug statement (#9352) 2026-04-01 19:56:14 -06:00
Andy Leiserson 11db97cf1b fix(core): Use more checked arithmetic (#9357) 2026-04-01 15:23:21 -07:00
Dylan Blokhuis 438ed2a7ce feat(core): support building custom geometry BLAS (#9290) 2026-04-01 20:55:22 +13:00
Kristoffer Søholm fd04edc0ac Fix bad debug_assert in dx12 indirect multi draw (#9332) 2026-03-31 13:46:25 -04:00
Andy Leiserson e14050d7db fix(core): Fix resource usage for R/O depth w/o TEXTURE_BINDING (#9346)
* fix(core): Fix resource usage for R/O depth w/o TEXTURE_BINDING

Fixes #9343

* Update test and waive failure

Related to #5231

* changelog
2026-03-31 17:02:11 +02:00
Andy Leiserson da19f17121 fix(core): Add validation in create_render_bundle_encoder (#9289) 2026-03-27 14:33:10 +01:00
Erich Gubler e6854ecf38 fix(core): panic on overflow for set_immediate's params. not coercing to usize 2026-03-18 12:16:00 -06:00
Erich Gubler 854ed79fd4 fix(core)!: validate set_immediate's values_offset param. 2026-03-18 12:16:00 -06:00
Erich Gubler 2a3dd23b03 fix(core)!: properly handle end offset overrun for immediate data 2026-03-18 12:16:00 -06:00
Niklas EickerandConnor Fitzgerald 62c2f5da97 Move ordered usages to hals (#8924)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2026-03-15 03:23:32 +00:00
Erich Gubler 405fedbb05 refactor: use Iterator::any for max_compute_workgroups_per_dimension check (#9194) 2026-03-11 11:39:05 -04:00
Andy Leiserson d152e7369b Reduce binary bloat from error vtables (#9149) 2026-03-04 08:52:24 -08:00
Mikołaj Radkowski 665cb34e32 Fix multi-planar texture copying (#9069) 2026-03-01 12:14:03 +01:00
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 3676e0e247 fix(core): Validate occlusion query set type in begin_render_pass (#9086) 2026-02-23 14:38:46 -08:00
Erich GublerandJim Blandy f24e8a9273 fix(core)!: validate start + size for buffer ops in more places
Co-authored-by: Jim Blandy <jimb@red-bean.com>
2026-02-20 10:34:58 -05:00
Erich Gubler 7d27b2f1e4 refactor(core)!: replace TransferError::BufferOverrun::end_offset with transfer's size
BREAKING CHANGE: Transfer operations are expressed in terms of a start
offset and a size. Trying to store anything else in errors and traces
yields extra complexity and loses clarity. Change
`TransferError::BufferOverrun` so that its `end_offset` field is no
more. Instead, add a `size` field that should only ever be saving off
fields already provided by user operations.
2026-02-20 10:34:58 -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
Erich Gubler 55a906767a refactor: satisfy clippy::manual_is_multiple_of for transfer alignment checks (#9072) 2026-02-17 23:34:25 -05:00
Luo Zhihao c0f04c801c Validate strip_index_format equals index buffer format for indexed drawing with strip topology 2026-02-01 23:14:52 -08:00
Vecvec f3b5243db7 Refactor build_acceleration_structures to require fewer passes (#8904) 2026-01-28 16:14:28 -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
Andy Leiserson 1481b23e55 Clean up imports/exports in wgpu_core::command (#8836) 2026-01-09 12:23:34 -08:00
Andy Leiserson e412592b23 Store failed commands in traces 2026-01-09 15:55:33 +01:00
SuchAFuriousDeath 490f1f4153 fix(core): set is_open only after begin_encoding succeeds (#8765) 2025-12-22 17:59:12 -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
teoxoy 61f08ed2d2 use Binder in RenderBundleEncoder.finish 2025-12-16 18:06:51 +01:00
teoxoy 54e47d7f97 move condition inside Binder::change_pipeline_layout 2025-12-16 18:06:51 +01:00
Connor Fitzgerald e52e8336b0 Bring immediate api in line with spec (#8724) 2025-12-16 13:13:09 +01:00
Andy Leiserson 500e2baedf Enable CTS suite api,validation,encoding,cmds,compute_pass (#8698) 2025-12-09 18:54:51 -05:00
Andy Leiserson 422d539731 Add missing maxColorAttachmentBytesPerSample validation for render passes (#8697) 2025-12-09 13:32:57 -08:00
Andy Leiserson 1ddb5f25c2 Fix early out placement for CopyB2T (#8690) 2025-12-08 21:17:07 -05:00
Teodor Tanasoaia d41e43bc60 [wgpu-core] validate occlusion and pipeline statistics queries end (#8684) 2025-12-08 18:42:26 +01:00