wgpu/naga
dependabot[bot] 1616c24561
build(deps): bump the patch-updates group with 24 updates (#6470)
Bumps the patch-updates group with 24 updates:

| Package | From | To |
| --- | --- | --- |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.90` | `1.0.91` |
| [serde](https://github.com/serde-rs/serde) | `1.0.210` | `1.0.213` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.64` | `1.0.65` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.40.0` | `1.41.0` |
| [syn](https://github.com/dtolnay/syn) | `2.0.82` | `2.0.85` |
| [anstream](https://github.com/rust-cli/anstyle) | `0.6.15` | `0.6.17` |
| [anstyle](https://github.com/rust-cli/anstyle) | `1.0.8` | `1.0.9` |
| [anstyle-parse](https://github.com/rust-cli/anstyle) | `0.2.5` | `0.2.6` |
| [anstyle-query](https://github.com/rust-cli/anstyle) | `1.1.1` | `1.1.2` |
| [anstyle-wincon](https://github.com/rust-cli/anstyle) | `3.0.4` | `3.0.6` |
| [bytes](https://github.com/tokio-rs/bytes) | `1.7.2` | `1.8.0` |
| [colorchoice](https://github.com/rust-cli/anstyle) | `1.0.2` | `1.0.3` |
| [fdeflate](https://github.com/image-rs/fdeflate) | `0.3.5` | `0.3.6` |
| [minicov](https://github.com/Amanieu/minicov) | `0.3.5` | `0.3.6` |
| [pin-project](https://github.com/taiki-e/pin-project) | `1.1.6` | `1.1.7` |
| [pin-project-internal](https://github.com/taiki-e/pin-project) | `1.1.6` | `1.1.7` |
| [pin-project-lite](https://github.com/taiki-e/pin-project-lite) | `0.2.14` | `0.2.15` |
| [proc-macro2](https://github.com/dtolnay/proc-macro2) | `1.0.88` | `1.0.89` |
| [regex](https://github.com/rust-lang/regex) | `1.11.0` | `1.11.1` |
| [rustix](https://github.com/bytecodealliance/rustix) | `0.38.37` | `0.38.38` |
| [serde_derive](https://github.com/serde-rs/serde) | `1.0.210` | `1.0.213` |
| [thiserror-impl](https://github.com/dtolnay/thiserror) | `1.0.64` | `1.0.65` |
| [wayland-client](https://github.com/smithay/wayland-rs) | `0.31.6` | `0.31.7` |
| [wayland-cursor](https://github.com/smithay/wayland-rs) | `0.31.6` | `0.31.7` |


Updates `anyhow` from 1.0.90 to 1.0.91
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.90...1.0.91)

Updates `serde` from 1.0.210 to 1.0.213
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.210...v1.0.213)

Updates `thiserror` from 1.0.64 to 1.0.65
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.64...1.0.65)

Updates `tokio` from 1.40.0 to 1.41.0
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.40.0...tokio-1.41.0)

Updates `syn` from 2.0.82 to 2.0.85
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.82...2.0.85)

Updates `anstream` from 0.6.15 to 0.6.17
- [Commits](https://github.com/rust-cli/anstyle/compare/anstream-v0.6.15...anstream-v0.6.17)

Updates `anstyle` from 1.0.8 to 1.0.9
- [Commits](https://github.com/rust-cli/anstyle/compare/v1.0.8...v1.0.9)

Updates `anstyle-parse` from 0.2.5 to 0.2.6
- [Commits](https://github.com/rust-cli/anstyle/compare/anstyle-parse-v0.2.5...anstyle-parse-v0.2.6)

Updates `anstyle-query` from 1.1.1 to 1.1.2
- [Commits](https://github.com/rust-cli/anstyle/compare/anstyle-query-v1.1.1...anstyle-query-v1.1.2)

Updates `anstyle-wincon` from 3.0.4 to 3.0.6
- [Commits](https://github.com/rust-cli/anstyle/compare/anstyle-wincon-v3.0.4...anstyle-wincon-v3.0.6)

Updates `bytes` from 1.7.2 to 1.8.0
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.7.2...v1.8.0)

Updates `colorchoice` from 1.0.2 to 1.0.3
- [Commits](https://github.com/rust-cli/anstyle/compare/colorchoice-v1.0.2...colorchoice-v1.0.3)

Updates `fdeflate` from 0.3.5 to 0.3.6
- [Changelog](https://github.com/image-rs/fdeflate/blob/main/CHANGES.md)
- [Commits](https://github.com/image-rs/fdeflate/compare/v0.3.5...v0.3.6)

Updates `minicov` from 0.3.5 to 0.3.6
- [Changelog](https://github.com/Amanieu/minicov/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Amanieu/minicov/compare/v0.3.5...v0.3.6)

Updates `pin-project` from 1.1.6 to 1.1.7
- [Release notes](https://github.com/taiki-e/pin-project/releases)
- [Changelog](https://github.com/taiki-e/pin-project/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/pin-project/compare/v1.1.6...v1.1.7)

Updates `pin-project-internal` from 1.1.6 to 1.1.7
- [Release notes](https://github.com/taiki-e/pin-project/releases)
- [Changelog](https://github.com/taiki-e/pin-project/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/pin-project/compare/v1.1.6...v1.1.7)

Updates `pin-project-lite` from 0.2.14 to 0.2.15
- [Release notes](https://github.com/taiki-e/pin-project-lite/releases)
- [Changelog](https://github.com/taiki-e/pin-project-lite/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/pin-project-lite/compare/v0.2.14...v0.2.15)

Updates `proc-macro2` from 1.0.88 to 1.0.89
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.88...1.0.89)

Updates `regex` from 1.11.0 to 1.11.1
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.11.0...1.11.1)

Updates `rustix` from 0.38.37 to 0.38.38
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Changelog](https://github.com/bytecodealliance/rustix/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.37...v0.38.38)

Updates `serde_derive` from 1.0.210 to 1.0.213
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.210...v1.0.213)

Updates `thiserror-impl` from 1.0.64 to 1.0.65
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.64...1.0.65)

Updates `wayland-client` from 0.31.6 to 0.31.7
- [Release notes](https://github.com/smithay/wayland-rs/releases)
- [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md)
- [Commits](https://github.com/smithay/wayland-rs/commits)

Updates `wayland-cursor` from 0.31.6 to 0.31.7
- [Release notes](https://github.com/smithay/wayland-rs/releases)
- [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md)
- [Commits](https://github.com/smithay/wayland-rs/commits)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: patch-updates
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: anstream
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: anstyle
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: anstyle-parse
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: anstyle-query
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: anstyle-wincon
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: bytes
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: patch-updates
- dependency-name: colorchoice
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: fdeflate
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: minicov
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: pin-project
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: pin-project-internal
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: pin-project-lite
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: proc-macro2
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: regex
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: rustix
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: serde_derive
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: thiserror-impl
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: wayland-client
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: wayland-cursor
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-29 08:25:41 +01:00
..
.cargo Move naga to subfolder 2023-10-25 14:25:04 -04:00
fuzz chore: release 22.0.0 2024-07-18 11:54:46 -04:00
hlsl-snapshots chore: #[must_use] annotations on getters and ctors 2024-08-19 14:38:05 +01:00
src refactor texture format to scalar conversion (#6451) 2024-10-23 20:06:40 +00:00
tests [hlsl-out] add support for restricting indexing to avoid OOB accesses 2024-10-23 16:51:44 +02:00
xtask chore: format TOML files with taplo 0.9.3 2024-10-11 14:40:01 -04:00
.gitattributes Move naga to subfolder 2023-10-25 14:25:04 -04:00
.gitignore Move naga to subfolder 2023-10-25 14:25:04 -04:00
build.rs Introduce hlsl-out-if-target-windows feature to Naga 2024-07-09 09:53:39 +02:00
Cargo.toml build(deps): bump the patch-updates group with 24 updates (#6470) 2024-10-29 08:25:41 +01:00
CHANGELOG.md build(deps): bump crate-ci/typos from 1.24.6 to 1.26.0 (#6399) 2024-10-21 00:23:43 +00:00
README.md Bump core MSRV to 1.76 2024-07-20 15:55:28 -04:00

Naga

Matrix Crates.io Docs.rs Build Status MSRV codecov.io

The shader translation library for the needs of wgpu.

Supported end-points

Front-end Status Feature Notes
SPIR-V (binary) spv-in
WGSL wgsl-in Fully validated
GLSL 🆗 glsl-in GLSL 440+ and Vulkan semantics only
Back-end Status Feature Notes
SPIR-V spv-out
WGSL 🆗 wgsl-out
Metal msl-out
HLSL hlsl-out Shader Model 5.0+ (DirectX 11+)
GLSL 🆗 glsl-out GLSL 330+ and GLSL ES 300+
AIR
DXIL/DXIR
DXBC
DOT (GraphViz) 🆗 dot-out Not a shading language

= Primary support — 🆗 = Secondary support — 🚧 = Unsupported, but support in progress

Conversion tool

Naga can be used as a CLI, which allows testing the conversion of different code paths.

First, install naga-cli from crates.io or directly from GitHub.

# release version
cargo install naga-cli

# development version
cargo install naga-cli --git https://github.com/gfx-rs/wgpu.git

Then, you can run naga command.

naga my_shader.wgsl # validate only
naga my_shader.spv my_shader.txt # dump the IR module into a file
naga my_shader.spv my_shader.metal --flow-dir flow-dir # convert the SPV to Metal, also dump the SPIR-V flow graph to `flow-dir`
naga my_shader.wgsl my_shader.vert --profile es310 # convert the WGSL to GLSL vertex stage under ES 3.20 profile

As naga includes a default binary target, you can also use cargo run without installation. This is useful when you develop naga itself or investigate the behavior of naga at a specific commit (e.g. wgpu might pin a different version of naga than the HEAD of this repository).

cargo run my_shader.wgsl

Development workflow

The main instrument aiding the development is the good old cargo test --all-features --workspace, which will run the unit tests and also update all the snapshots. You'll see these changes in git before committing the code.

If working on a particular front-end or back-end, it may be convenient to enable the relevant features in Cargo.toml, e.g.

default = ["spv-out"] #TEMP!

This allows IDE basic checks to report errors there unless your IDE is sufficiently configurable already.

Finally, when changes to the snapshots are made, we should verify that the produced shaders are indeed valid for the target platforms they are compiled for:

cargo xtask validate spv # for Vulkan shaders, requires SPIRV-Tools installed
cargo xtask validate msl # for Metal shaders, requires XCode command-line tools installed
cargo xtask validate glsl # for OpenGL shaders, requires GLSLang installed
cargo xtask validate dot # for dot files, requires GraphViz installed
cargo xtask validate wgsl # for WGSL shaders
cargo xtask validate hlsl dxc # for HLSL shaders via DXC
cargo xtask validate hlsl fxc # for HLSL shaders via FXC