Commit Graph
2246 Commits
Author SHA1 Message Date
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
atlv fc9060f510 BarycentricNoPerspective (#8852) 2026-01-15 19:42:44 -05:00
Vecvec bdc8f618c1 Use invalidate not flush when reading back from device. (#8838) 2026-01-15 15:25:46 -05:00
Luo Zhihao 2b8b5f7cdc Fix typo in docs regarding memory init tracker (#8858) 2026-01-12 09:26:03 -05:00
Sam 11666170b4 expose adapter info on device (#8807)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-01-09 13:50:49 -07:00
Andy Leiserson 1481b23e55 Clean up imports/exports in wgpu_core::command (#8836) 2026-01-09 12:23:34 -08:00
Andy Leiserson cd7958561a Restore tracing support in wgpu
The loop/break changes in `play.rs` are reverting changes made in #4202.

Fixes #5974
2026-01-09 15:55:33 +01:00
Andy Leiserson d6b788829e docs(core): Update ID-related doc comments 2026-01-09 15:55:33 +01:00
Andy Leiserson 3bd29ef6eb Tracing tests 2026-01-09 15:55:33 +01:00
Andy Leiserson 985da29bcf Add in-memory tracing and inline data in traces 2026-01-09 15:55:33 +01:00
Andy Leiserson e412592b23 Store failed commands in traces 2026-01-09 15:55:33 +01:00
Andy Leiserson 376a36a9d2 fix(core): Validate storage texture formats when creating BGLs (#8735)
This moves existing validation from binding creation to BGL
creation. Binding creation already had a check that returns
`CreateBindGroupError::InvalidStorageTextureFormat` if the format
does not match the layout, so it is not necessary to revalidate
the format support at that point.
2026-01-07 17:00:57 +01:00
Erich Gubler 727cbc3d13 refactor(core): debug_assert that we wrote at least one deduction for maxInterStageShaderVariables errors 2026-01-05 14:59:38 -08:00
Erich Gubler 6bf665ab26 fix(core): do not deduct Position built-in from maxInterStageShaderVariables 2026-01-05 14:59:38 -08:00
Erich Gubler cd271a6be7 fix(core): compare fragment input indices against maxInterStageShaderVariables directly, not max_fragment_input_variables 2026-01-05 14:59:38 -08:00
Erich Gubler a2c8c0de7c docs(core): add (one among others) spec. citation for logic in Interface::check_stage 2025-12-23 16:09:17 -05:00
Erich Gubler 6948a01d8c fix(core): remove max_inter_stage_shader_components validation 2025-12-23 16:09:17 -05:00
Erich Gubler a26de1262c fix(core): add fragment-stage max_inter_stage_shader_variables validation 2025-12-23 16:09:17 -05:00
Erich Gubler bfb153222b fix(core): add vertex-stage max_inter_stage_shader_variables validation (minus clip-distances)
Notable public API additions:

- New `StageError` variants:
	- `VertexOutputLocationTooLarge`
	- `TooManyVertexOutputs`
- Add new `shader_io_deductions` submodule of `wgpu_core::validation` with:
	- A `ShaderIoDeduction` trait
	- `enum MaxVertexShaderOutputDeduction`
	- `MaxInterStageShaderVariablesDeductions` for them.
2025-12-23 16:09:17 -05:00
Erich Gubler 344eeb4bc8 refactor(core): migrate from naga::ShaderStage to new ShaderStageForValidation
In order to prepare for spec.-compliant validation of shader I/O, we
need to create a new `enum` that will have the same set of _variants_ as
`naga::ShaderStage`, but will carry additional information relevant to
validation. As a preparatory step, create the new `enum` (called
`ShaderStageForValidation`), and use it as the source of truth for
details of the stage being validated. This yields several immediate
benefits, even before making adjustments for the new validation:

- Stage-specific stage is now properly encapsulated. `compare_function`,
  which was previously passed as a `Option`al sibling argument, is now
  properly associated with only the vertex shader stage.
  - This led to an odd discovery that `compare_function` was being
    provided to `check_stages` with other stages, but not actually
    actually checked. This seems like a rightfully squashed bug.
- Instead of passing a `wgpu_types::ShaderStages` (with a single bit)
  and `naga::ShaderStage` side-by-side, encapsulate both into conversion
  methods for an instance of `ShaderStageForValidation`, so errors are
  impossible to make.
2025-12-23 16:09:17 -05:00
Erich Gubler f71d51a356 refactor(core): reverse conv. b/w wgt::ShaderStages and naga::ShaderStage
This will better prepare for the subsequent commit, which supplants
`naga::ShaderStage` as the source of truth in this code.
2025-12-23 16:09:17 -05:00
Erich Gubler 05c1746ac6 refactor(core): make Interface::shader_stage_from_stage_bit a free function 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
Andy Leiserson df4ae64df6 Check GPUDepthStencilState.format even when neither is enabled (#8766)
Fixes #8736
2025-12-22 18:33:59 -08:00
SuchAFuriousDeath 490f1f4153 fix(core): set is_open only after begin_encoding succeeds (#8765) 2025-12-22 17:59:12 -05:00
Dzmitry Malyshau bff1f6d095 (Naga) Cooperative Matrix Support (#8251) 2025-12-22 13:14:57 -05:00
Erich Gubler bdf7d9bb5d fix(core): s/COPY_SRC/COPY_DST/ for first transition in external texture init. (#8760) 2025-12-19 13:53:47 -08: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
Andy Leiserson 6dd69b0567 core: Reject zero-size bindings in createBindGroup (#8734) 2025-12-16 18:22:00 +00:00
Teodor Tanasoaia 5c76751104 [d3d12] add support for optional adapter telemetry (#8576) 2025-12-16 12:34:29 -05: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 4a91c7fc6c Ensure the limit for storage binding size honors alignment (#8719) 2025-12-15 12:42:17 -05:00
Lucas Abel 17ebb2a656 [core] Queue::drop is acquiring the snatch guard as well (#8691) 2025-12-15 11:59:24 -05:00
Erich Gubler a35e5a28c1 feat(core): add Global::create_bind_group_layout_error (#8650) 2025-12-11 19:56:09 +00: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 d6ca9462e4 Fix panic if indirect buffer has been destroyed (#8689) 2025-12-08 21:17:52 -05: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
Andy Leiserson 51490ea45a [naga] Add capabilities governing binding array types (#8671) 2025-12-08 17:11:03 +01:00
Connor Fitzgerald 136edde52a Widen checks for the creation of the indirect validator 2025-12-08 12:26:45 +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
Layl 21e6143ed0 Add MULTISAMPLE_ARRAY feature flag. (#8571) 2025-12-05 18:31:05 +01:00
Connor Fitzgerald d85408afb2 Remove hold of snatch write lock during present (#8608) 2025-12-05 10:44:04 -05:00
Connor FitzgeraldandJMS55 9a41de4e96 Move subgroup size info to AdapterInfo (#8609)
Co-authored-by: JMS55 <47158642+JMS55@users.noreply.github.com>
2025-12-04 17:01:56 +00:00
Connor Fitzgerald 5895de82b5 Rename push constants to immediates (#8586) 2025-12-01 15:20:02 +01:00