Commit Graph
449 Commits
Author SHA1 Message Date
Dragoy 66d997113f naga: include OpAtomicCompareExchange result access in emitted range (#9621) 2026-06-03 20:03:55 +02:00
Andy Leiserson 4c1ea47ea2 fix(dx12): Fix textureNum{Levels,Layers,Samples} functions (#9542) 2026-05-13 17:51:15 +02:00
Dzmitry Malyshau 1781d73b40 msl: fix cooperative matrix loading semantics (#9451) 2026-05-12 14:20:06 -07:00
Andy Leiserson 20d6629185 fix(naga): Don't panic on oversize types (#9516) 2026-05-11 18:58:12 +02:00
teoxoy 786b8b11da [hlsl] handle matCx2<f16> in the uniform address space properly 2026-05-07 20:22:15 +02:00
teoxoy 22720cf121 fix reading from uniform variables of type array<matCx2<T>, N> 2026-05-07 20:22:15 +02:00
JMS55 868eb17098 SHADER_I16 full support (#9412) 2026-04-24 20:49:41 -04:00
Vecvec 56e4a389dd [spv-out] ray tracing pipelines (#9085) 2026-04-20 17:02:49 +02:00
Andy Leiserson b051a87e3e fix(naga): Require explicit flat interpolation for integer shader I/O 2026-04-17 11:50:51 -07:00
Andy Leiserson 75ed5df337 test: Add snapshot test for GLSL interpolation spec 2026-04-17 11:50:51 -07:00
AliandConnor Fitzgerald c040694c94 fixed mat2xc alignment in spv (#9369)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2026-04-15 20:52:49 +00:00
Vecvec f6d9a1dbaa [msl-out] Switch to intersection queries (#9304) 2026-04-15 16:01:28 -04:00
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
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
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
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
Erich Gubler 3c13b5e68c fix(metal): unconditionally enable CLIP_DISTANCES 2026-03-20 10:58:29 -06: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
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