Commit Graph
417 Commits
Author SHA1 Message Date
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
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
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 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
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
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
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
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
Andy Leiserson 6e16e04a44 fix(naga): Detect overflowing const shift amounts at compile time 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
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 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
Jim Blandy 81a1e8d3cf [naga wgsl-in] Don't permit template parameters after enumerants. 2026-01-28 12:00:35 +01:00
teoxoy 94cc5187dd [wgsl] pass expected token to functions that might not match any tokens
This improves errors making them more general where appropriate.
2026-01-28 12:00:35 +01:00
teoxoy ac18c06ba6 [wgsl-out] avoid shadowing built-ins 2026-01-28 12:00:35 +01:00
teoxoy 34ab7363ef adjust GLSL snapshots 2026-01-28 12:00:35 +01:00
teoxoy 1ef831ad2c handle all type resolution in the lowerer 2026-01-28 12:00:35 +01:00
teoxoy cb401cef90 handle bitcast, coopLoad and construction exprs in the lowerer 2026-01-28 12:00:35 +01:00
teoxoy c20919c5ee [wgsl] update reserved list to latest CR 2026-01-28 12:00:35 +01:00
teoxoy 626f5514b6 remove Clone derive from the Lexer
also fixes spans in some cases
2026-01-28 12:00:35 +01:00
teoxoy d17a98fbc0 add function that parses variable, value, func call and variable updating statements 2026-01-28 12:00:35 +01:00
teoxoy 7d653d9c08 update lhs_expression to be in line with the spec 2026-01-28 12:00:35 +01:00
Andy Leiserson 0e558f27ef fix(naga): Support dual-source blending for SPIR-V shaders (#8865) 2026-01-28 09:19:57 +01: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
mandryskowski 2ef10891d2 Fix constant evaluation of sign(0.0f) (#8942) 2026-01-27 19:41:10 +00:00
Inner DaemonsandErich Gubler 4d11f5f8de Made traces use .metal extension instead of .msl (#8880)
* Changed msl snapshots to use .metal extension

* Made traces use `.metal` extension instead of `.msl`

* Added changelog entry

---------

Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2026-01-26 17:25:43 +00:00
Jan eaffaf2024 [glsl-in] fix missing side effects from sequence expressions (#8787) 2026-01-20 13:07:46 +01:00
Andy Leiserson 2d56ec6cdc fix(naga wgsl-out): Emit wgpu_cooperative_matrix extension when needed 2026-01-19 10:38:47 +01:00
Andy Leiserson b40c01a018 fix(naga wgsl-in): Add checks for wgpu_cooperative_matrix extension 2026-01-19 10:38:47 +01:00
Inner Daemons 48ba9812c2 Add support for SPV_KHR_non_semantic_info (#8827)
* Upload

* Added changelog entry

* More comments

* Updated changelog to reflect SUPPORTED_EXT_SETS being removed
2026-01-16 03:06:32 +00:00
Vecvec c97fe3e7c4 [HLSL] Make ray queries safer. (#8763) 2026-01-15 21:35:18 -05:00
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
cryvosh 1d520a098d Fix workgroupUniformLoad returning atomic types (#8791) 2026-01-10 12:21:48 -08:00
Moritz Zielke cb02f74aa4 fix(naga): avoid vector splat construction from invalid scalar type (#8829) 2026-01-08 15:06:14 -08:00
Moritz Zielke 6e55831aec fix(naga): don't crash on zero value of dynamically-sized array (#8741) 2026-01-07 01:48:34 +00:00
Jamie Nicol 1f4ae6733c [naga test] Run hlsl_mat_cxN.wgsl snapshot tests on SPIR-V too
Additionally rename the tests to remove the "hlsl_" prefix.
2026-01-06 11:28:24 +00:00