Commit Graph
1080 Commits
Author SHA1 Message Date
Connor Fitzgerald 384b7bb027 Update codespan-reporting to 0.13 (#9243) 2026-03-16 21:52:58 +00:00
Andy Leiserson 6604345c2e fix(naga msl-out): Fix invalid MSL when vertex data and shader type are both f16 (#9166) 2026-03-16 13:03:58 -06:00
ecoricemonandConnor Fitzgerald cbc20f698c fix(naga): Check domain and overflow in const-eval (#9224)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2026-03-16 11:22:30 -06:00
renovate[bot]andConnor Fitzgerald f778c388be chore(deps): update dependencies (#9240)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2026-03-16 17:12:12 +00:00
Inner DaemonsandAndreas Reich 96b7872f77 Fix local_invocation_id and local_invocation_index handling (#9099)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2026-03-15 20:25:19 +00:00
Inner Daemons 41f7c288de Added fix and regression test for primitive id on FXC (#9218) 2026-03-13 23:51:03 +01:00
teoxoy 0a4cfc40f1 [wgsl] allow concretization to other valid scalars 2026-03-13 16:24:43 +01:00
atlv 4e7ffe0938 Workaround Metal driver bug with atomic texture writes (#9185) 2026-03-13 11:01:23 -04:00
atlv 9ed77372b4 Add coherent and volatile memory decorations for storage buffers. (#9168) 2026-03-11 19:53:52 -04:00
Dzmitry Malyshau da77a43313 Update naga capabilities for TLAS array 2026-03-11 08:18:38 -07:00
Dzmitry Malyshau e39b3aec8e Plumbing and a test for ACCELERATION_STRUCTURE_BINDING_ARRAY 2026-03-11 08:18:38 -07:00
ecoricemon eb3bc87b21 fix(naga): Implement constant matrix add/sub/mul (#9162)
* fix(naga): Implement constant matrix operations

Implement binary operations in naga constant evaluator
- multiplication on vector-matrix, matrix-vector, and matrix-matrix
- addition/subtraction on matrix-matrix

* Related CTS
webgpu:shader,validation,expression,matrix,* : 1678/1881 (89.21%) -> 1737/1881 (92.34%)
> remaining fail : overflow/underflow (126), atomic (18)

* naga snapshots updated automatically

* chore: Update naga snapshots
2026-03-10 22:09:00 +01:00
Andy Leiserson ce631c139f fix(naga): Evaluate compound assignment LHS before RHS (#9181) 2026-03-09 23:33:27 +00:00
John Tur 74baec71b4 Support SSBOs and compute shaders when provided through GL extensions (#9169) 2026-03-07 21:17:12 -05:00
Erich Gubler 477dcb8918 chore: restore correctness commentary removed in #9074 (#9165) 2026-03-05 20:13:48 -05:00
Andy Leiserson 14ea13f11f fix(naga): Reject matrix negation in WGSL (#9157)
* fix(naga): Reject matrix negation

* Polyfill matrix negation for GLSL
2026-03-05 18:12:37 -05:00
Andy Leiserson 0f6fd0b207 refactor(naga): Consolidate logic for checking enable extensions (#9107) 2026-03-04 18:25:46 -05:00
ecoricemon 966d5d8e8c fix(naga): Validate invalid binary operations (#9126)
* fix(naga): Validate invalid binary operations

Changes
1. Incompatible Comparison: Added validation to prevent comparisons between different scalar types, such as 42i == 42u.
2. Compose-Scalar Operations: Added checks for unsupported binary operations between compose types and scalars, such as mat2x2f(...) + 1.0f.

CTS change
* webgpu:shader,validation,expression,matrix,*
 - Pass ratio: 1570/1881 (83.47%) -> 1678/1881 (89.21%)
* webgpu:shader,validation,expression,binary,*
 - Pass ratio: 4635/4992 (92.85%) -> 4786/4992 (95.87%)

* refactor: Move bin operand check out of match arms
2026-03-03 18:09:17 +01:00
ecoricemon 0d166c51a8 fix(naga): Allow a trailing comma in WGSL attributes (#9127)
* fix(naga): Allow trailing comma in WGSL attributes

Allow trailing comma token in WGSL attributes such as '@location(1,)'

CTS change
* webgpu:shader,validation,shader_io,*
 - Pass ratio: 2369/2891 (81.94%) -> 2380/2891 (82.32%)

* Update CTS list related to #8892
2026-03-03 18:06:06 +01:00
ecoricemon b6c605603f fix(naga): Validate presence of pipeline constants (#9133)
* fix(naga): validate presence of pipeline constants

Cause an error if a pipeline constant identifier doesn't exist in the shader

CTS change
* webgpu:api,validation,compute_pipeline:overrides,identifier:* : 12/26 (46.15%) -> 26/26 (100%)

* fix: Sort test.lst
2026-03-03 15:25:26 +01:00
Brendon Daugherty 3dc03bc23f fix(naga): Use wrapping arithmetic for dot on concrete ints (#9142) 2026-03-03 15:06:18 +01:00
Andy Leiserson da1d8c62a3 Avoid excessive ArrayVec monomorphization (#9122) 2026-03-03 14:41:09 +01:00
7caf9fabc3 [spv-in] Improve detection of ImageClass (#8758)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2026-03-01 11:37:26 +00:00
Inner Daemons fdd903e6e4 Add supported caps info to naga backends (#9068)
* Initial commit

* 3/5 done I think

* Updated naga bin to use new caps

* Made clippy shut up

* Tried to fix dota2 validation error

* HLSL list made, also formatted Cargo.toml

* Made stuff work with snapshots

* Added changelog and GLSL list

* Updated message
2026-02-23 06:44:20 -07: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
Vecvec 0bae2959fe Use all ray tracing pipeline builtins (#8998) 2026-02-19 01:56:00 -05:00
Andy LeisersonandJim Blandy c4365b9818 fix(naga): Improve validation of non-constructible types (#8873)
* fix(naga): Improve validation of non-constructible types

Fixes #4720
Fixes the test cases in #7393, but not the issue itself

* Zero-constructing texture_2d is no longer caught by front end.

* Define `TypeInner::is_constructible`; use it in `front::wgsl`.

Add a new method `TypeInner::is_constructible`, that determines
whether WGSL considers a type [constructible]. Use this to generate
errors in the WGSL front end. Assert in validation that it matches the
judgment of `Validator::validate_type`.

[constructible]: https://gpuweb.github.io/gpuweb/wgsl/#constructible-types

---------

Co-authored-by: Jim Blandy <jimb@red-bean.com>
2026-02-18 11:08:53 -08:00
Inner Daemons c0fbf119a7 Forbid unsafe code in naga (#9074) 2026-02-18 08:07:24 -07:00
Vecvec 157cf36844 [wgsl-out] Ray tracing pipelines (#8970)
* wgsl-out rt pipelines

* Format.

* Enable the ray tracing pipeline extension.

* Add more checks for ray tracing pipelines.

* Changelog.

* Remove ir target.
2026-02-15 15:42:08 -05: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 7609ed99e5 Add draw_id builtin (#8883) 2026-02-11 20:47:29 +00:00
Inner Daemons 702c4ef4da [wgsl] gate primitive_index built-in behind its extension & [glsl-out] require extensions for gl_PrimitiveID if needed (#8879) 2026-02-10 12:40:41 +01:00
Connor Fitzgerald 04746e747e Implement 3 part MSRV policy (#8999) 2026-02-08 17:04:36 -05:00
Andy Leiserson 6e16e04a44 fix(naga): Detect overflowing const shift amounts at compile time 2026-02-03 12:59:48 +01:00
Andy Leiserson afbb31eb1a fix(naga): Disallow const shifts of scalar by vector or vice-versa 2026-02-03 12:59:48 +01:00
Andy Leiserson dbab82fe42 chore(naga): Downgrade some log messages to debug 2026-02-03 12:59:48 +01:00
Andy Leiserson 28bc72f5bc fix(naga): Validate swizzles in lowering (#8949) 2026-02-03 01:38:28 +00:00
Teodor Tanasoaia a54dec07eb [wgsl-in] Avoid looking up newly introduced parameter names while parsing function parameters and its return type. (#8980) 2026-02-02 06:15:05 -07:00
Mads Marquart b9c09622ce fix(naga): Fix macOS 10.12 nested initializers
The Metal 2.0 compiler (shipped with macOS 10.13 and Xcode 9.0) has
allowed flattening aggregate initializers, but when running on macOS
10.12, we still use the old compiler, so to support that, we need to use
nested initializer lists.
2026-02-01 22:37:52 -08:00
Andy Leiserson 2c9e77a19d clippy: Adjust large-error-threshold and remove waivers (#8974) 2026-01-30 22:37:24 -05:00
Andy Leiserson 6b108091cc test(naga): Change test span generator to a struct (#8968) 2026-01-30 10:11:07 -05:00
Andy Leiserson c6bf076d78 fix(naga): Reject unsupported enable extensions (#8913)
Previously we required that the enable extension be declared and that
the capability be present if the functionality was used, but allowed the
extension to be declared if the functionality was not used.
2026-01-30 10:08:04 -05:00
Andy Leiserson a24965f8b7 fix(naga): Coerce matrix initializers to concrete floats (#8817) 2026-01-29 18:00:26 -08:00
Andy LeisersonandJim Blandy 70a7f83ea8 naga: Enforce @must_use for built-in functions (#8713)
---------

Co-authored-by: Jim Blandy <jimb@red-bean.com>
2026-01-29 15:03:29 -08:00
Vecvec 8a37e0f56a [wgsl in and IR] naga ray tracing pipelines (#8570) 2026-01-29 14:18:56 -05:00
Andy Leiserson b512f7e36f test(naga): Tests for mesh shader extension validation (#8871) 2026-01-28 16:36:30 -05:00
Erich Gubler 59c351be6a refactor: satisfy clippy::unnecessary_unwrap
New in Rust 1.93! Reference:
[`clippy::unnecessary_unwrap`](https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#unnecessary_unwrap)
2026-01-28 15:42:38 -05:00
Erich Gubler 33a91d4ada refactor(spv-out): subvert-replace "recycle" in trait Recyclable to "reclaim"
This avoids `rustc` errors new to Rust 1.93. These errors are because
`Recyclable::recycle` triggers the `unstable_name_collisions` lint on
use, detecting a collision with the unstable `vec_recycle` Nightly
feature.
2026-01-28 15:42:38 -05:00
Jim Blandy 1add139b75 [naga wgsl-in] Consolidate bitcast and coopLoad handling.
In `naga::front::wgsl::lower::Lowerer::call_builtin`, consolidate the
cases for `bitcast`, `coopLoad`, and `coopLoadT` with the other
miscellaneous builtin functions.
2026-01-28 12:36:21 -08:00
Jim Blandy 7b473a7aba [naga wgsl-in] Move builtin function calls into their own fn.
Move the code for handling calls to WGSL builtin functions out of
`Lowerer::call` and into its own new function,
`Lowerer::call_builtin`, for clarity. Do template parameter list
finalization in the caller.
2026-01-28 12:36:21 -08:00