Commit Graph
936 Commits
Author SHA1 Message Date
Jim Blandy fccadd6f07 [naga wgsl-in] Restore accidentally removed recursion depth check. (#9424) 2026-04-14 09:22:29 +02:00
AliandErich Gubler 51faa6fd87 Implements #8875: Using binding_array should require an enable extension (#9298)
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2026-04-11 04:52:44 +00:00
Neel Tamtam 7159dfcc14 fix: restore changelog entry and remove redundant atomic load guard (#9400) 2026-04-10 14:17:15 -04:00
atlv e6e5f5288c Bring immediate in line with webgpu spec (#9280) 2026-04-09 22:36:02 +00:00
Neel TamtamandConnor Fitzgerald f0201c9cc3 Fix: Polyfill atomic load/store correctly in GLSL/HLSL (#9242) (#9387)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2026-04-09 01:49:19 +00:00
Inner Daemons 948b1a6c66 Remove unnecessary object data threadgroup barriers in MSL writer (#9396) 2026-04-08 16:05:17 -07:00
Ali 9c49f92347 fix fragment ignoring reserved keywords in metal (#9379) 2026-04-07 16:15:24 -06:00
renovate[bot]andAndreas Reich 6635e4dda1 chore(deps): update crate-ci/typos action to v1.45.0 (#9376)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2026-04-07 20:36:03 +02:00
Inner DaemonsandAndreas Reich b5bd5aed7d Mesh shaders MSL writer (#8739)
* Single squashed commit

* Updated changelog

* Fixed stupid changelog thing

* If I have to do this one more fucking time I'm gonna lose it

* Removed some pub(super)'s

* Thing

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2026-04-07 17:26:22 +00:00
Ali 74827c4181 Implements #9176 : [[max_total_threads_per_threadgroup]] MSL attribute (#9327)
* Implements #9176 : `[[max_total_threads_per_threadgroup]]` MSL attribute

* introduced `DownlevelFlags::MSL2_1`
2026-04-07 11:40:13 +02:00
dnsn021anddongsong 3a8b7eaf05 fix(naga): validate @must_use usage on non-function declarations (#9367)
---------

Co-authored-by: dongsong <dongsong@pkpm.com.cn>
2026-04-03 17:20:04 +00:00
Ali c58092266e fixed incorrect packed_int3 conversion generated for Metal (#9355) 2026-04-02 13:29:04 -06:00
Brendon Daugherty 1080b4faf3 fix(wgsl-in): Handle Unterminated Block Comments (#9356) 2026-04-02 13:26:21 -06:00
e46eda2e4f Full per_vertex implementation (#9219)
* Some stuff worked on

* Works on MSL

* Ready for test 2

* Fix for a thing lol

* Fixed 2 errors

* Fixed DXC

* Add changelog

* Updated CI to hopefully pass on macOS

* Various fixes

* Some final fixes

* CHanged CI

* Update naga/src/front/wgsl/parse/directive/enable_extension.rs

Co-authored-by: atlv <email@atlasdostal.com>

* Thing

---------

Co-authored-by: atlv <email@atlasdostal.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2026-04-02 05:33:42 +00:00
Andy Leiserson 59c0c54029 Fix minor issues with @size attribute (#9322)
* test(cts): List updates

* fix(naga): Disallow @size on dynamically-sized arrays

* fix(naga): Increase MAX_TYPE_SIZE to i32::MAX
2026-03-30 16:56:09 +02:00
Ali a071a4d5aa Fixes #9283 : firstLeadingBit returns signed semantics result instead… (#9299)
* Fixes #9283 : firstLeadingBit returns signed semantics result instead of unsigned for u32 input 0xFFFFFFFF on Metal backend

* updates snapshots

* added  to passing tests
2026-03-26 14:46:43 +01:00
cui a58f51a256 fix(naga): report offending index in IndexOutOfBounds for AccessIndex (#9312) 2026-03-26 11:34:21 +01:00
ecoricemon 96675e5215 fix(naga): Reject direct access to atomic variables (#9262)
* fix(naga): Reject direct access to atomic variables

* resolve CHANGELOG conflict

* chore: Update CTS list
2026-03-25 18:23:34 +01:00
RobandJim Blandy 73600f11d7 Add no_std support for the naga/wgsl-in feature (#9055)
* add no_std support for naga/wgsl-in

* simplify emit_to_string_with_path signature to use &str instead of std::path::Path

* inline hexf-parse

* update Cargo.lock and .deny.toml

* Do provide full path in snapshot error messages.

---------

Co-authored-by: Jim Blandy <jimb@red-bean.com>
2026-03-25 08:12:33 -07:00
Inner Daemons a53ffffe38 Mesh shader HLSL writer (#8752) 2026-03-24 15:42:38 -04:00
Kevin Reid 1148bac37c Convert comments on lint attributes to reasons. (#9292) 2026-03-24 18:58:52 +00:00
Andy Leiserson 8ddbd2d236 fix(naga): Disallow derivatives for f16 (#9154) 2026-03-24 17:52:47 +00:00
ecoricemon d199493486 fix(naga): Raise an error on division by zero (#9276)
Add validation about division by zero in valiator.  Plus, fix div/rem on i32 in
const-eval.
Relevant spec <https://gpuweb.github.io/gpuweb/wgsl/#arithmetic-expr> says
"If e1 is most negative value in T, and e2 is -1: ..." which means -MIN / -1 is
an error. This is exercised by CTS.
2026-03-23 21:18:54 +01:00
ecoricemon 97e235fde8 fix(naga): Fix const evaluation on bool (#9275) 2026-03-23 21:13:11 +01:00
Erich Gubler 3c13b5e68c fix(metal): unconditionally enable CLIP_DISTANCES 2026-03-20 10:58:29 -06:00
Erich Gubler cc1a10f24a fix(msl-out): print resolved binding before array length
This only really applies to `[[clip_distances]]` right now, but Teo and
I are pretty sure this is the right order for other attributes we might
add for array types, too.
2026-03-20 10:58:29 -06:00
ecoricemon bb73dd843c fix(naga): Add validation for some math builtins in const-eval (#9249)
Added validation on builtin math functions `acosh`, `length`,
`normalize`, and `pow` during const evaluation.
2026-03-20 09:47:41 -07:00
Erich Gubler b7de7886b4 refactor: use plural "clip distances" for cross-platform layers (#9267) 2026-03-19 23:19:33 +00:00
Andy Leiserson 0e2650781c fix: dual-source blending validation
- Validate `@blend_src` structs in type validation. The spec requires
  validating any struct with `@blend_src` attributes, whether or not
  it is used by an entry point.
- Remove `@blend_src`-related interface validation that is
  redundant with the type validation.
- Dual-source blending requires that there be a single color
  attachment.
2026-03-18 09:52:01 -07:00
Andy Leiserson 3cb29686ae refactor(naga): Update IO_SHAREABLE definition 2026-03-18 09:52:01 -07:00
ecoricemon 93fe05dd35 fix(naga): Validate matrix constructors (#9207)
Added column validation in matrix constructors.

CTS change
webgpu:shader,validation,expression,call,builtin,value_constructor:*
481/483 -> 483/483 (100%)
2026-03-17 13:24:20 -06:00
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