Commit Graph
27 Commits
Author SHA1 Message Date
Inner Daemons a53ffffe38 Mesh shader HLSL writer (#8752) 2026-03-24 15:42:38 -04: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
Connor Fitzgerald af2d45e3f3 [naga xtask] Remove cargo xtask bench 2025-12-03 11:29:56 -05: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
Connor Fitzgerald ff0de91ad7 Bump REPO_MSRV to 1.88 (#7960) 2025-07-17 13:00:40 -04:00
Connor Fitzgerald 8235cd2932 Use no_main to allow xtasks to compile on wasm 2025-04-27 18:34:52 +02:00
Christian Legnitto 6ef9b8256a [naga msl-out] invalid code emitted for minimum i32/i64 value literal.
The literal `-2147483648` is parsed by Metal as negation of positive
2147483648. As 2147483648 is too large for a int, the expression is
silently promoted to a long. Sometimes this does not matter as it will
often be implicitly converted back to an int after the negation.
However, if the expression is used in a bitcast then we hit a compiler
error due to mismatched bitwidths.

Similarily for `-9223372036854775808`, as 9223372036854775808 is too
large for a long, metal emits a `-Wconstant-conversion` warning and
changes the value to -9223372036854775808. This would then be negated
again, possibly causing undefined behaviour.

In both cases we can avoid the issue by expressing the literals as the
second most negative value expressible by the type, minus one.

eg `-2147483647 - 1` and `-9223372036854775807L - 1L`.

We have added a test which uses the most negative i32 literal in an
addition. Because we bitcast addition operands to unsigned in metal,
this would cause a validation error without this fix. For the i64 case
existing tests already make use of the minimum literal value. Passing
the flag `-Werror=constant-conversion` to Metal during validation will
therefore catch this issue.
2025-04-09 14:13:03 -04:00
Connor Fitzgerald 1ec34839ee Improve Validation Errors with Naga Validator (#7185) 2025-02-21 10:57:59 -05:00
Erich Gubler 65d499f302 Clean up naga's xtask a bit (#7014) 2025-01-28 16:26:38 +00:00
Connor FitzgeraldandGuus Waals b0f1fa66ef Add VisionOS Support (#6888)
* Add visionos support

* Use `target_vendor = "apple"`

* Fixes

* Build VisionOS

* Gah

* Bleh

* Typos

---------

Co-authored-by: Guus Waals <_@guusw.nl>
2025-01-10 17:33:58 +00:00
Erich Gubler aaac47c24e fix(naga): s/os/target_os/ in xtask's FXC/DXC check (#6774) 2024-12-17 16:12:24 -05:00
Imbris 6d7975eb3b [naga hlsl-out glsl-out] Work around backend loop/switch bugs.
Introduce a new module, `naga::back::continue_forward`, containing
shared code for rendering Naga `Continue` statements as backend
`break` statements and assignments to introduced `bool` locals.
See the module's documentation for details.

- [hlsl-out] Transform degenerate single body switches into `do-while`
  loops. Properly render `Continue` statements enclosed by
  `Switch` statements enclosed by `Loop` statements.

- [glsl-out] Transform degenerate single body switches into `do-while`
  loops.

Improve `naga xtask validate spv` error message.

Fixes #4485.
Fixes #4514.
2024-07-23 18:12:19 -07:00
vero 1c48a23cff Add Metal 3.0 and 3.1 detection (#5497) 2024-04-05 19:22:33 +02:00
Erich Gubler e45a86fa7c [naga xtask] Add and use ValidateSubcommand::all.
Add an `all` method to `ValidateSubcommand`, so that we can just use
matches elsewhere, and let the compile catch missing or duplicated
cases for us.
2023-12-27 13:07:09 -08:00
Jim Blandy 71f18fd61a [naga xtask] Use anyhow::ensure! where appropriate. 2023-12-27 13:07:09 -08:00
Jim Blandy 3e252ac2f3 [naga xtask] Use log::error in preference to eprintln. 2023-12-27 13:07:09 -08:00
Jim Blandy de3df51807 [naga xtask] Add validate all subcommand. 2023-12-27 13:07:09 -08:00
Jim Blandy 403db446e4 [naga xtask] Run validation jobs in parallel, using jobserver. 2023-12-27 13:07:09 -08:00
Jim Blandy 85ab6327d3 [naga xtask] Use indicatif crate to report validation progress. 2023-12-27 13:07:09 -08:00
Jim Blandy a1a8b6d445 [naga xtask] Remove ack_visiting function. 2023-12-27 13:07:09 -08:00
Jim Blandy 0d25acba68 [naga xtask] Collect validation jobs in a Vec before running them. 2023-12-27 13:07:09 -08:00
Jim Blandy 17a9166c26 [naga xtask] Produce output only when an error occurs. 2023-12-27 13:07:09 -08:00
Jim Blandy 41276a1731 [naga xtask] Break validation subcommands into functions. 2023-12-27 13:07:09 -08:00
Jim Blandy 9041bb94db [naga xtask] Move validation subcommands into their own module. 2023-12-27 13:07:09 -08:00
Jim Blandy 9afd54ea24 [naga xtask] Use naga-cli's --bulk-validate option.
Use `naga --bulk-validate` for `cargo xtask validate wgsl`, reducing
runtime from 12s to 0.8s.
2023-12-24 12:03:28 -08:00
Connor Fitzgerald 34e947de4b Integration of Naga into Repo (#4296) 2023-10-25 16:51:36 -04:00
Connor Fitzgerald 5369eec3b2 Move naga to subfolder 2023-10-25 14:25:04 -04:00