* chore(deps): bump the patch-updates group with 19 updates Bumps the patch-updates group with 19 updates: | Package | From | To | | --- | --- | --- | | [anyhow](https://github.com/dtolnay/anyhow) | `1.0.94` | `1.0.95` | | [argh](https://github.com/google/argh) | `0.1.12` | `0.1.13` | | [bytemuck](https://github.com/Lokathor/bytemuck) | `1.20.0` | `1.21.0` | | [env_logger](https://github.com/rust-cli/env_logger) | `0.11.5` | `0.11.6` | | [itertools](https://github.com/rust-itertools/itertools) | `0.10.5` | `0.13.0` | | [libc](https://github.com/rust-lang/libc) | `0.2.168` | `0.2.169` | | [png](https://github.com/image-rs/image-png) | `0.17.15` | `0.17.16` | | [serde_json](https://github.com/serde-rs/json) | `1.0.133` | `1.0.134` | | [gpu-descriptor](https://github.com/zakarumych/gpu-descriptor) | `0.3.0` | `0.3.1` | | [syn](https://github.com/dtolnay/syn) | `2.0.90` | `2.0.91` | | [argh_derive](https://github.com/google/argh) | `0.1.12` | `0.1.13` | | [argh_shared](https://github.com/google/argh) | `0.1.12` | `0.1.13` | | [bytemuck_derive](https://github.com/Lokathor/bytemuck) | `1.8.0` | `1.8.1` | | [cc](https://github.com/rust-lang/cc-rs) | `1.2.4` | `1.2.5` | | [const_panic](https://github.com/rodrimati1992/const_panic) | `0.2.10` | `0.2.11` | | [env_filter](https://github.com/rust-cli/env_logger) | `0.1.2` | `0.1.3` | | [hashbrown](https://github.com/rust-lang/hashbrown) | `0.14.5` | `0.15.2` | | [home](https://github.com/rust-lang/cargo) | `0.5.9` | `0.5.11` | | [object](https://github.com/gimli-rs/object) | `0.36.5` | `0.36.7` | Updates `anyhow` from 1.0.94 to 1.0.95 - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.94...1.0.95) Updates `argh` from 0.1.12 to 0.1.13 - [Release notes](https://github.com/google/argh/releases) - [Commits](https://github.com/google/argh/compare/0.1.12...0.1.13) Updates `bytemuck` from 1.20.0 to 1.21.0 - [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md) - [Commits](https://github.com/Lokathor/bytemuck/compare/v1.20.0...v1.21.0) Updates `env_logger` from 0.11.5 to 0.11.6 - [Release notes](https://github.com/rust-cli/env_logger/releases) - [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md) - [Commits](https://github.com/rust-cli/env_logger/compare/v0.11.5...v0.11.6) Updates `itertools` from 0.10.5 to 0.13.0 - [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-itertools/itertools/compare/v0.10.5...v0.13.0) Updates `libc` from 0.2.168 to 0.2.169 - [Release notes](https://github.com/rust-lang/libc/releases) - [Changelog](https://github.com/rust-lang/libc/blob/0.2.169/CHANGELOG.md) - [Commits](https://github.com/rust-lang/libc/compare/0.2.168...0.2.169) Updates `png` from 0.17.15 to 0.17.16 - [Changelog](https://github.com/image-rs/image-png/blob/master/CHANGES.md) - [Commits](https://github.com/image-rs/image-png/compare/v0.17.15...v0.17.16) Updates `serde_json` from 1.0.133 to 1.0.134 - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.133...v1.0.134) Updates `gpu-descriptor` from 0.3.0 to 0.3.1 - [Changelog](https://github.com/zakarumych/gpu-descriptor/blob/master/CHANGELOG.md) - [Commits](https://github.com/zakarumych/gpu-descriptor/commits) Updates `syn` from 2.0.90 to 2.0.91 - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.90...2.0.91) Updates `argh_derive` from 0.1.12 to 0.1.13 - [Release notes](https://github.com/google/argh/releases) - [Commits](https://github.com/google/argh/compare/0.1.12...0.1.13) Updates `argh_shared` from 0.1.12 to 0.1.13 - [Release notes](https://github.com/google/argh/releases) - [Commits](https://github.com/google/argh/compare/0.1.12...0.1.13) Updates `bytemuck_derive` from 1.8.0 to 1.8.1 - [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md) - [Commits](https://github.com/Lokathor/bytemuck/compare/bytemuck_derive-v1.8.0...bytemuck_derive-v1.8.1) Updates `cc` from 1.2.4 to 1.2.5 - [Release notes](https://github.com/rust-lang/cc-rs/releases) - [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md) - [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.4...cc-v1.2.5) Updates `const_panic` from 0.2.10 to 0.2.11 - [Release notes](https://github.com/rodrimati1992/const_panic/releases) - [Changelog](https://github.com/rodrimati1992/const_panic/blob/main/Changelog.md) - [Commits](https://github.com/rodrimati1992/const_panic/commits) Updates `env_filter` from 0.1.2 to 0.1.3 - [Release notes](https://github.com/rust-cli/env_logger/releases) - [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md) - [Commits](https://github.com/rust-cli/env_logger/compare/env_filter-v0.1.2...env_filter-v0.1.3) Updates `hashbrown` from 0.14.5 to 0.15.2 - [Changelog](https://github.com/rust-lang/hashbrown/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/hashbrown/commits) Updates `home` from 0.5.9 to 0.5.11 - [Changelog](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/cargo/compare/home-0.5.9...home-0.5.11) Updates `object` from 0.36.5 to 0.36.7 - [Changelog](https://github.com/gimli-rs/object/blob/master/CHANGELOG.md) - [Commits](https://github.com/gimli-rs/object/compare/0.36.5...0.36.7) --- updated-dependencies: - dependency-name: anyhow dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: argh dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: bytemuck dependency-type: direct:production update-type: version-update:semver-minor dependency-group: patch-updates - dependency-name: env_logger dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: itertools dependency-type: direct:production update-type: version-update:semver-minor dependency-group: patch-updates - dependency-name: libc dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: png dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: gpu-descriptor dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: argh_derive dependency-type: indirect update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: argh_shared dependency-type: indirect update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: bytemuck_derive dependency-type: indirect update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: cc dependency-type: indirect update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: const_panic dependency-type: indirect update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: env_filter dependency-type: indirect update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: hashbrown dependency-type: indirect update-type: version-update:semver-minor dependency-group: patch-updates - dependency-name: home dependency-type: indirect update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: object dependency-type: indirect update-type: version-update:semver-patch dependency-group: patch-updates ... Signed-off-by: dependabot[bot] <support@github.com> * Fix Errors * Get Fuzzed * Unbreak --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Naga
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