Commit Graph
837 Commits
Author SHA1 Message Date
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
Connor Fitzgerald e3149bac9e LoadOp::DontCare (#8549) 2025-12-08 03:41:38 +00:00
Connor Fitzgerald a356cb2026 Update Repo MSRV to 1.91 (#8678) 2025-12-07 21:52:35 -05:00
Connor Fitzgerald 5895de82b5 Rename push constants to immediates (#8586) 2025-12-01 15:20:02 +01:00
Connor Fitzgerald dc01e6e213 Normalize logging levels (#8579) 2025-11-27 10:55:02 +01:00
Andy Leiserson 7985f571be Adjust the placement of the zero size check for some texture copies (#8567) 2025-11-26 18:12:47 +01:00
Andy Leiserson 6043b059c4 Tweak error behavior for unbalanced passes, and update CTS (#8543) 2025-11-18 11:18:17 -05:00
Andy Leiserson 71820eef20 Fix performance regression in bind group processing (#8519) 2025-11-14 00:10:42 -05:00
Connor Fitzgerald f14458b067 Improve late buffer binding size error (#8484) 2025-11-07 03:21:25 +00:00
Erich Gubler e2e4651ecb fix(core): validate that buffer is unmapped in write_buffer calls 2025-11-05 16:12:58 -05:00
ad0f3111b7 Add multiview limits and tests (#8206)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
Co-authored-by: Magnus <85136135+SupaMaggie70Incorporated@users.noreply.github.com>
2025-11-01 12:08:15 +00:00
Kevin Reid 5633ae8649 Show command encoder label in validation errors.
The plumbing to get it out of `wgpu_core` is awkward but I didn’t see
a clearly better option. I think it would make sense to have something
like `Global::get_label<T>(id: Id<T>) -> String` but that looks like a
lot more work.
2025-10-31 13:03:55 -04:00
Andy Leiserson 5ac2ed19cb Fix serde feature gating 2025-10-30 13:52:58 +01:00
Andy Leiserson c501ef68df Remove stale attributes 2025-10-30 13:52:58 +01:00
Andy Leiserson 9d0fd2153b Condition macro_rules_attribute dev-dependency on serde feature 2025-10-30 13:52:58 +01:00
Andy Leiserson 07ce023cf1 Replay traces with pointers as IDs 2025-10-30 13:52:58 +01:00
Andy Leiserson 67da4cbc03 Store pointers instead of IDs when tracing (2/2)
This updates non-pass command encoder operations and device operations.
2025-10-30 13:52:58 +01:00
Andy Leiserson e584f382e0 Store pointers instead of IDs when tracing (1/2)
This updates pass operations.

The trace player is temporarily broken.
2025-10-30 13:52:58 +01:00
Andy Leiserson 5798a443d2 Add ReferenceType trait for command structures
Use it to deduplicate some `Foo` / `ArcFoo` / `TraceFoo` definitions.
2025-10-30 13:52:58 +01:00
Mikołaj Radkowski e7fcb94888 Make multi-planar textures renderable (#8307) 2025-10-29 13:33:48 -04:00
Erich Gubler 54beef8aca typo: TransferError:InvalidMipLevel: s/does no/does not/ (#8437) 2025-10-28 21:11:17 +01:00
Andy Leiserson 3ca6a1c0df Defer some bind group processing until draw/dispatch
This allows us to save some work when a bind group is replaced,
although WebGPU still requires us to fail a submission if any
resource in any bind group that was ever referenced during
encoding is destroyed.

Fixes #8399
2025-10-23 14:59:25 +02:00
Andy Leiserson e8dfc72d04 Small refactors related to bind group tracking for compute passes
* Don't remove resources from the usage scope, it is not necessary, and
  not useful, since we don't verify the scope is empty afterwards.
* Avoid some unnecessary `unsafe`.
2025-10-23 14:59:25 +02:00
Andy Leiserson 7f644452f0 Check for attachment overlap using textures, not views (#8402) 2025-10-22 17:37:38 +02:00
Andy Leiserson d575c0234b Disallow mixing the raw encoding API with the wgpu API (#8373) 2025-10-22 11:34:40 -04:00
OpsticandConnor Fitzgerald f0209e3db8 Add support for transient textures on Vulkan and Metal (#8247)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-10-16 19:50:01 +00:00
Andy Leiserson 3f7dae1a30 Additional api_logging for passes (#8326) 2025-10-13 13:19:29 -04:00
Andy Leiserson 3958790a85 refactor: Split finish between Global and CommandEncoder (#8288) 2025-10-09 15:13:45 +02:00
Andy LeisersonandAndreas Reich 1967900565 Encode commands on finish (#8220)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2025-09-25 14:22:51 -04:00
Andy Leiserson 04a3401638 Extract command encoding to free functions (#8210) 2025-09-11 15:15:33 -04:00
Andy Leiserson 67bdd80a38 Add cbindgen:ignore directives (#8212) 2025-09-11 19:10:05 +00:00
Andy Leiserson aaf52e93d9 Move some *Copy*Info types out of wgpu_core::command::transfer
In the future `transfer` will want to use the `Arc` versions of these
types. I have exported them from `wgpu_core::command::ffi`, to document
that these are used for FFI purposes, and from `wgpu_core::command`, for
backwards compatibility, although I also change the in-tree uses to
use them from `wgpu_types` instead of from `wgpu_core::command`.
2025-09-11 10:20:03 -07:00