Commit Graph
943 Commits
Author SHA1 Message Date
Vecvec 7721a3e065 [spv-out] handle rayQueryTerminate correctly. (#8581) 2025-12-15 12:53:39 -05:00
Andy Leiserson 12259ba9f4 naga: Accept var<function> syntax for local variables (#8710) 2025-12-11 17:40:29 -05:00
Andy Leiserson ab8f9ad517 Specify individual capabilities for each snapshot test (#8688) 2025-12-08 18:34:04 -05:00
Andy Leiserson 51490ea45a [naga] Add capabilities governing binding array types (#8671) 2025-12-08 17:11:03 +01:00
Connor Fitzgerald a356cb2026 Update Repo MSRV to 1.91 (#8678) 2025-12-07 21:52:35 -05:00
Connor Fitzgerald af2d45e3f3 [naga xtask] Remove cargo xtask bench 2025-12-03 11:29:56 -05:00
Kevin Reid afec4b73c8 [glsl-out] Split some code out of glsl/mod.rs
These items get their own files, roughly matching the style of other
backends:

* `Writer`
* Miscellaneous conversion functions
2025-12-01 19:40:25 -05:00
Kevin Reid d2c6f44454 [spv-in] Split spv/mod.rs into two files.
`Frontend::next_block()` is the bulk of the logic, and moving it and
nothing else into a separate file produces an even split in half.

This is, of course, inferior to figuring out some way to make the huge
function smaller, but it should be a cheap benefit to editability
meanwhile.
2025-12-01 19:40:25 -05:00
Connor Fitzgerald 5895de82b5 Rename push constants to immediates (#8586) 2025-12-01 15:20:02 +01:00
atlv 75188a7fe1 Fix mesh shader naga capability bit (#8588) 2025-11-28 03:45:07 +00:00
Connor Fitzgerald dc01e6e213 Normalize logging levels (#8579) 2025-11-27 10:55:02 +01:00
Martin Svanberg f114138e52 Support STORAGE_RESOURCE_BINDING_ARRAY on Metal (#8464) 2025-11-26 20:18:10 -05:00
Moritz Zielke 3a157f7497 test(naga): assert error for ImageStore type mismatch (#8494) 2025-11-26 12:51:58 -05:00
Andy Leiserson 119b4efada [naga wgsl-in] Short-circuiting of && and || operators (#7339)
Addresses parts of #4394 and #6302
2025-11-19 17:06:49 -08:00
David Rivera 1f99103be8 [naga msl-out] Annotate dot product functions as wrapped functions 2025-11-19 10:40:21 -08:00
Andy Leiserson e620027f95 [naga] Move some helper functions to type_methods 2025-11-19 10:40:21 -08:00
Vecvec 7ba1a0e41c Add enable extensions for ray queries and ray query vertex returns. (#8545) 2025-11-18 15:56:47 -05:00
Vecvec efca3f5066 [spirv] Make ray queries safer (#8390) 2025-11-13 00:33:32 -05:00
a05c70cef7 WGSL parsing for mesh shaders (#8370)
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: SupaMaggie70Incorporated <85136135+SupaMaggie70Incorporated@users.noreply.github.com>
2025-11-12 21:06:20 -05:00
Jim Blandy 2e34322f9a [naga] De-indent mainline control flow in interface validation. (#8359)
In `naga::valid::interface::VaryingContext::validate`, use `let else`
instead of `match`, to promote the main flow of control to a lower
indentation level, and move error reporting closer to the check that
failed.
2025-11-05 13:45:38 -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
bf9f7524ec Add mesh shading info to naga IR (#8104)
Co-authored-by: Jim Blandy <jimb@red-bean.com>
Co-authored-by: SupaMaggie70Incorporated <85136135+SupaMaggie70Incorporated@users.noreply.github.com>
2025-10-29 14:49:51 -04:00
atlv 7a2afeb014 fix(vulkan): remove atomic memory semantics (#8391) 2025-10-29 13:21:56 -04:00
atlv ddcd89fd69 Implement shader barycentrics (#8320) 2025-10-29 13:15:21 -04:00
Erich Gubler 18f4ed66c0 chore: satisfy unused_parens lint (#8424) 2025-10-23 18:35:18 -04:00
withtimezone 4ea04a69c9 chore: remove repetitive words in comment (#8385) 2025-10-20 14:42:54 -04:00
SamandSelkoSays 6e76a98c99 [naga const-eval] LiteralVector and some demo builtins (#8223)
* [naga] Add `LiteralVector` and `match_literal_vector!`

Co-authored-by: SelkoSays <70065171+SelkoSays@users.noreply.github.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* [naga] Implement builtins dot, length, distance, normalize in const using LiteralVector

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Update snapshots

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: SelkoSays <70065171+SelkoSays@users.noreply.github.com>
2025-10-18 07:28:09 -04:00
Teodor Tanasoaia 1072b87894 Fix stray comma in function signatures in Metal (#8311)
Fixes a regression introduced by #8265 where we were mistakenly writing a comma before the first buffer argument (if no other arguments were printed before it).
2025-10-06 18:59:45 +00:00
Connor Fitzgerald ad15442b89 Improve error message when image write without format used (#8294) 2025-10-06 19:25:25 +02:00
Connor Fitzgerald 482a983e10 Release v27 (#8287) 2025-10-01 19:36:18 -04:00
renovate[bot]andConnor Fitzgerald 9380b87755 chore(deps): update cargo.lock (#8229)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-10-01 22:42:49 +00:00
Jim Blandy 43eccd28f8 [naga] Remove naga::path_like. Use String instead. (#8284)
Delete the `naga::path_like` module, and simply using `String` and
`str` instead.

Nothing in Naga uses `Path` or `PathBuf` methods; indeed, Naga only
converts these values back and forth from string-like types with
`to_string_lossy` and `into`, such that using string-like, rather than
path-like, types actually simplifies the code.

This also avoids dead code warnings starting in Rust 1.89 that would
otherwise require distracting `#[cfg_attr]` conditionals.
2025-10-01 18:08:18 +02:00
Erich Gubler 5146b3f8ae fix(namer): normalize ":<>," characters to a snake case separator 2025-10-01 08:50:37 -04:00
Erich Gubler 90702156af fix(namer): escape, rather than strip, non-ASCII ident. characters
Escape non-ASCII identifier characters with `write!(…, "u{:04x}", …)`,
surrounding with `_` as appropriate. This solves (1) a debugging issue
where stripped characters would otherwise be invisible, and (2) failure
to re-validate that stripped identifiers didn't start with an ASCII
digit.

I've confirmed that this fixes [bug
1978197](https://bugzilla.mozilla.org/show_bug.cgi?id=1978197) on the
Firefox side.
2025-10-01 08:50:37 -04:00
Erich Gubler 06fc6f7345 feat(wgsl): recognize enable primitive-index; (#8237) 2025-09-30 22:02:10 +00:00
Nils Hasenbanck 8c4aebc0c1 (Naga) Implement OpImageGather and OpImageDrefGather when ingesting SPIR-V (#8280) 2025-09-29 13:15:32 -04:00
Nils Hasenbanck 8cb94db802 (Naga) Add support for Storage Image Multisample when ingesting SPIR-V (#8270) 2025-09-29 11:45:39 -04:00
Andy Leiserson a01ffb7967 Fix unused warning in a specific feature config (#8271) 2025-09-29 11:44:05 -04:00
Teodor Tanasoaia ce96254f4f [msl] fix vertex pulling with a stride of 0 (#8265) 2025-09-26 13:37:37 -04:00
Nils Hasenbanck 2f7ebf1401 (Naga) Add support for Descriptor Runtime Indexing when ingesting SPIR-V (#8256) 2025-09-25 08:25:04 -04:00
05cc6dca82 [hal/dx12] Mesh Shaders (#8110)
* Features and draw commands added

* Tried to implement the pipeline creation (completely untested)

* Fixed clippy issues

* Fixed something I think

* A little bit of work on the mesh shader example (currently doesn't work on dx12)

* Reached a new kind of error state

* Fixed an alignment issue

* DirectX 12 mesh shaders working :party:

* Removed stupid change and updated changelog

* Fixed typo

* Added backends option to example framework

* Removed silly no write fragment shader from tests to see if anything breaks

* Tried to make mesh shader tests run elsewhere too

* Removed printlns and checked that dx12 mesh shader tests run

* Documented very strange issue

* I'm so lost

* Fixed stupid typos

* Fixed all issues

* Removed unnecessary example stuff, updated tests

* Updated typos.toml

* Updated limits

* Apply suggestion from @cwfitzgerald

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

* Apply suggestion from @cwfitzgerald

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

* Removed supported backends, made example & tests always pass the filename to shader compilers

* Removed excessive bools in test params

* Added new tests to the list

* I'm a sinner for this one (unused import)

* Replaced random stuff with test params hashing

* Updated typos.toml

* Updated -Fo typo thing

* Actually fixed typo issue this time

* Update CHANGELOG.md

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

* Update tests/tests/wgpu-gpu/mesh_shader/mod.rs

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

* Update wgpu-hal/src/dx12/mod.rs

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

* Addressed comments

* Lmao

---------

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-25 03:24:56 +00:00
Andy Leiserson 1f10d0ce8a [naga] Don't report shader errors as their own source (#8258) 2025-09-24 22:42:24 -04:00
Sam 084431b548 [naga] Implement atan2 in const (#8222)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-09-24 11:23:25 -07:00
Cai Bear d2ee4b8be5 Fix #8151. (#8215) 2025-09-24 16:03:58 +00:00
Jamie Nicol ba0b6b9b0e [vulkan, naga spv-out] Remap resource bindings
In order to support external textures, we must be able to map a single
external texture resource binding to multiple Vulkan descriptors. This
means we must be able to override the `Binding` and `DescriptorSet`
values for global variables when generating SPIR-V, rather than simply
passing through the group and binding values from Naga IR.

This patch extends the existing SPIR-V Naga backend's `BindingMap` to
contain a descriptor set and binding value in addition to the existing
array size. When creating BindGroupLayouts/BindGroups we use a
sequentially incrementing value for each entry's binding value,
continuing to just use the bind group index as the descriptor set
value.

The Naga backend looks up each resource in the map when emitting its
`Binding` and `DescriptorSet` decorations. If the entry cannot be
found in the map, it will either error or emit fake bindings based on
its configuration.
2025-09-24 17:55:35 +02:00
EriKWDev 3efd640178 naga: Correct spelling in wgsl parsing rg11b10float -> rg11b10ufloat (#8219) 2025-09-21 10:41:17 +00:00
Teodor Tanasoaia 0b38e96379 [msl] vertex pulling: fix unpacking snorm16x2 & snorm16x4 (#8249) 2025-09-19 18:11:31 -04:00
Matthias Reitinger b55c24cf27 [naga wgsl-in] Allow trailing comma in switch cases (#8165) 2025-09-16 07:58:23 -04:00
MagnusandConnor Fitzgerald 54ce9f7f98 Update shader bencher to share some logic with snapshots (#8108)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-09-11 00:55:42 +00:00
Andy Leiserson d31d944ed5 Clarify the effect of the SUBGROUP features and capabilities (#8203) 2025-09-10 20:53:56 -04:00