From d9a425b160b5d1606734a24a2922a4dc5099a91e Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Wed, 25 Oct 2023 15:05:19 -0400 Subject: [PATCH] First Pass --- .github/CODEOWNERS | 1 + .github/workflows/cts.yml | 96 ----- {naga/.github => .github}/workflows/lazy.yml | 5 +- .github/workflows/publish.yml | 5 +- .../workflows/validation-linux.yml | 19 +- .../workflows/validation-macos.yml | 13 +- .../workflows/validation-windows.yml | 19 +- Cargo.lock | 342 +++++++++++++++++- Cargo.toml | 21 +- {naga/cli => naga-cli}/Cargo.toml | 2 +- {naga/cli => naga-cli}/src/bin/naga.rs | 0 naga/.github/CODEOWNERS | 1 - naga/Cargo.toml | 14 - naga/LICENSE-APACHE | 201 ---------- naga/LICENSE-MIT | 19 - naga/codecov.yml | 1 - wgpu-core/Cargo.toml | 3 +- wgpu-hal/Cargo.toml | 6 +- 18 files changed, 382 insertions(+), 386 deletions(-) delete mode 100644 .github/workflows/cts.yml rename {naga/.github => .github}/workflows/lazy.yml (98%) rename {naga/.github => .github}/workflows/validation-linux.yml (59%) rename {naga/.github => .github}/workflows/validation-macos.yml (62%) rename {naga/.github => .github}/workflows/validation-windows.yml (77%) rename {naga/cli => naga-cli}/Cargo.toml (97%) rename {naga/cli => naga-cli}/src/bin/naga.rs (100%) delete mode 100644 naga/.github/CODEOWNERS delete mode 100644 naga/LICENSE-APACHE delete mode 100644 naga/LICENSE-MIT delete mode 100644 naga/codecov.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 1d6e147803..2a7eb39e4c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,3 +2,4 @@ /cts_runner/ @gfx-rs/deno @gfx-rs/wgpu /deno_webgpu/ @gfx-rs/deno @gfx-rs/wgpu +/naga/ @gfx-rs/naga diff --git a/.github/workflows/cts.yml b/.github/workflows/cts.yml deleted file mode 100644 index d6eb8903f5..0000000000 --- a/.github/workflows/cts.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: CTS - -on: - push: - branches: [master, staging] - tags: [v0.*] - pull_request: - types: [labeled, opened, synchronize] - -env: - CARGO_INCREMENTAL: false - CARGO_TERM_COLOR: always - RUST_BACKTRACE: full - MSRV: "1.70" - -jobs: - cts: - # Only run if we add this label - if: contains(github.event.pull_request.labels.*.name, 'needs testing') - - strategy: - fail-fast: false - matrix: - include: - # Windows - - name: Windows x86_64 - os: windows-2019 - target: x86_64-pc-windows-msvc - backends: dx12 # dx11 - - # Linux - #- name: Linux x86_64 - # os: ubuntu-20.04 - # target: x86_64-unknown-linux-gnu - # backends: vulkan # gl - - name: CTS ${{ matrix.name }} - runs-on: ${{ matrix.os }} - - steps: - - name: checkout repo - uses: actions/checkout@v4 - with: - path: wgpu - - - name: checkout cts - run: | - git clone https://github.com/gpuweb/cts.git - cd cts - git checkout $(cat ../wgpu/cts_runner/revision.txt) - - - name: Install Repo MSRV toolchain - run: | - rustup toolchain install ${{ env.MSRV }} --no-self-update --profile=minimal --target ${{ matrix.target }} - rustup override set ${{ env.MSRV }} - cargo -V - - - name: caching - uses: Swatinem/rust-cache@v2 - with: - key: cts-a # suffix for cache busting - working-directory: wgpu/cts_runner - target-dir: wgpu/cts_runner/target - - - name: install llvmpipe and lavapipe - if: matrix.os == 'ubuntu-20.04' - run: | - sudo apt-get update -y -qq - sudo add-apt-repository ppa:oibaf/graphics-drivers -y - sudo apt-get update - sudo apt install -y libxcb-xfixes0-dev mesa-vulkan-drivers - # libegl1-mesa libgl1-mesa-dri for gl - - # We enable line numbers for panics, but that's it - - name: disable debug - shell: bash - run: | - mkdir -p wgpu/.cargo - echo """[profile.dev] - debug = 1" > wgpu/.cargo/config.toml - - - name: build CTS runner - run: | - cargo build --manifest-path wgpu/cts_runner/Cargo.toml - - - name: run CTS - shell: bash - run: | - cd cts; - for backend in ${{ matrix.backends }}; do - echo "======= CTS TESTS $backend ======"; - grep -v '^//' ../wgpu/cts_runner/test.lst | while IFS=$' \t\r\n' read test; do - echo "=== Running $test ==="; - DENO_WEBGPU_BACKEND=$backend cargo run --manifest-path ../wgpu/cts_runner/Cargo.toml --frozen -- ./tools/run_deno --verbose "$test"; - done - done diff --git a/naga/.github/workflows/lazy.yml b/.github/workflows/lazy.yml similarity index 98% rename from naga/.github/workflows/lazy.yml rename to .github/workflows/lazy.yml index ab5e21f129..e7dfe79aaf 100644 --- a/naga/.github/workflows/lazy.yml +++ b/.github/workflows/lazy.yml @@ -2,10 +2,7 @@ name: lazy on: push: - branches: [master] - pull_request: - paths: - - '.github/workflows/lazy.yml' + branches: [trunk] env: CARGO_INCREMENTAL: false diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f0aa086961..978b788a3e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,9 +2,8 @@ name: Publish on: push: - branches: ["*"] - pull_request: - merge_group: + branches: + - trunk env: CARGO_INCREMENTAL: false diff --git a/naga/.github/workflows/validation-linux.yml b/.github/workflows/validation-linux.yml similarity index 59% rename from naga/.github/workflows/validation-linux.yml rename to .github/workflows/validation-linux.yml index 0c1525e7db..da8d2ad306 100644 --- a/naga/.github/workflows/validation-linux.yml +++ b/.github/workflows/validation-linux.yml @@ -1,18 +1,15 @@ -name: validation-linux +name: naga-validation-linux + on: + push: + branches: ["*"] + tags: [v0.*] pull_request: - paths: - - '.github/workflows/validation-linux.yml' - - 'tests/out/spv/*.spvasm' - - 'tests/out/glsl/*.glsl' - - 'tests/out/dot/*.dot' - - 'tests/out/wgsl/*.wgsl' - - 'src/front/wgsl/*' - - 'xtask/**' + merge_group: jobs: validate-linux: - name: SPIR-V + GLSL + name: Validate Naga SPIR-V + GLSL Output runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -23,7 +20,7 @@ jobs: - uses: Swatinem/rust-cache@v2 with: workspaces: | - xtask -> target + naga/xtask -> naga/xtask/target - run: cargo xtask validate spv diff --git a/naga/.github/workflows/validation-macos.yml b/.github/workflows/validation-macos.yml similarity index 62% rename from naga/.github/workflows/validation-macos.yml rename to .github/workflows/validation-macos.yml index c06563dc12..3ba1e5d335 100644 --- a/naga/.github/workflows/validation-macos.yml +++ b/.github/workflows/validation-macos.yml @@ -1,14 +1,15 @@ name: validation-macos + on: + push: + branches: ["*"] + tags: [v0.*] pull_request: - paths: - - '.github/workflows/validation-macos.yml' - - 'tests/out/msl/*.msl' - - 'xtask/**' + merge_group: jobs: validate-macos: - name: MSL + name: Validate Naga MSL Output runs-on: macos-latest steps: - uses: actions/checkout@v3 @@ -16,6 +17,6 @@ jobs: - uses: Swatinem/rust-cache@v2 with: workspaces: | - xtask -> target + naga/xtask -> naga/xtask/target - run: cargo xtask validate msl diff --git a/naga/.github/workflows/validation-windows.yml b/.github/workflows/validation-windows.yml similarity index 77% rename from naga/.github/workflows/validation-windows.yml rename to .github/workflows/validation-windows.yml index 536b71d7b6..d2a0e21ae7 100644 --- a/naga/.github/workflows/validation-windows.yml +++ b/.github/workflows/validation-windows.yml @@ -1,16 +1,15 @@ name: validation-windows + on: + push: + branches: ["*"] + tags: [v0.*] pull_request: - paths: - - '.github/workflows/validation-windows.yml' - - 'tests/out/hlsl/*.hlsl' - - 'tests/out/hlsl/*.ron' - - 'xtask/**' - - 'hlsl-snapshots/**' + merge_group: jobs: validate-windows-dxc: - name: HLSL via DXC + name: Validate Naga HLSL Output on DXC runs-on: windows-latest steps: - uses: actions/checkout@v3 @@ -21,12 +20,12 @@ jobs: - uses: Swatinem/rust-cache@v2 with: workspaces: | - xtask -> target + naga/xtask -> naga/xtask/target - run: cargo xtask validate hlsl dxc validate-windows-fxc: - name: HLSL via FXC + name: Validate Naga HLSL Output on FXC runs-on: windows-latest steps: - uses: actions/checkout@v3 @@ -43,6 +42,6 @@ jobs: - uses: Swatinem/rust-cache@v2 with: workspaces: | - xtask -> target + naga/xtask -> target - run: cargo xtask validate hlsl fxc diff --git a/Cargo.lock b/Cargo.lock index 54835b5561..a7bdbbe6b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -93,6 +93,12 @@ dependencies = [ "libc", ] +[[package]] +name = "anes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + [[package]] name = "anstream" version = "0.6.4" @@ -147,6 +153,46 @@ version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +[[package]] +name = "arbitrary" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2e1373abdaa212b704512ec2bd8b26bd0b7d5c3f70117411a5d9a451383c859" +dependencies = [ + "derive_arbitrary", +] + +[[package]] +name = "argh" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7af5ba06967ff7214ce4c7419c7d185be7ecd6cc4965a8f6e1d8ce0398aad219" +dependencies = [ + "argh_derive", + "argh_shared", +] + +[[package]] +name = "argh_derive" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56df0aeedf6b7a2fc67d06db35b09684c3e8da0c95f8f27685cb17e08413d87a" +dependencies = [ + "argh_shared", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "argh_shared" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5693f39141bda5760ecc4111ab08da40565d1771038c4a0250f03457ec707531" +dependencies = [ + "serde", +] + [[package]] name = "arrayref" version = "0.3.7" @@ -254,6 +300,15 @@ dependencies = [ "vsimd", ] +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + [[package]] name = "bit-set" version = "0.5.3" @@ -281,6 +336,7 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" dependencies = [ + "arbitrary", "serde", ] @@ -361,6 +417,12 @@ dependencies = [ "vec_map", ] +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + [[package]] name = "cc" version = "1.0.83" @@ -392,6 +454,33 @@ dependencies = [ "libc", ] +[[package]] +name = "ciborium" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" + +[[package]] +name = "ciborium-ll" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" +dependencies = [ + "ciborium-io", + "half", +] + [[package]] name = "clap" version = "4.4.7" @@ -601,6 +690,66 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "criterion" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" +dependencies = [ + "anes", + "cast", + "ciborium", + "clap", + "criterion-plot", + "is-terminal", + "itertools", + "num-traits 0.2.17", + "once_cell", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", +] + +[[package]] +name = "criterion-plot" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" +dependencies = [ + "cast", + "itertools", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset 0.9.0", + "scopeguard", +] + [[package]] name = "crossbeam-utils" version = "0.8.16" @@ -876,6 +1025,17 @@ dependencies = [ "deno_core", ] +[[package]] +name = "derive_arbitrary" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e0efad4403bfc52dc201159c4b842a246a14b98c64b55dfd0f2d89729dfeb8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -889,6 +1049,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + [[package]] name = "dispatch" version = "0.2.0" @@ -1468,6 +1634,12 @@ dependencies = [ "bitflags 2.4.1", ] +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + [[package]] name = "hashbrown" version = "0.14.2" @@ -1511,6 +1683,14 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" +[[package]] +name = "hlsl-snapshots" +version = "0.1.0" +dependencies = [ + "anyhow", + "nanoserde", +] + [[package]] name = "home" version = "0.5.5" @@ -1568,6 +1748,7 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ + "arbitrary", "equivalent", "hashbrown", "serde", @@ -1596,6 +1777,15 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -1774,6 +1964,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + [[package]] name = "metal" version = "0.27.0" @@ -1820,25 +2019,44 @@ dependencies = [ [[package]] name = "naga" version = "0.14.0" -source = "git+https://github.com/gfx-rs/naga?rev=92e41b43e437146b5d946eb238de963be1168016#92e41b43e437146b5d946eb238de963be1168016" dependencies = [ + "arbitrary", + "bincode", "bit-set", "bitflags 2.4.1", "codespan-reporting", + "criterion", + "diff", + "env_logger", "hexf-parse", + "hlsl-snapshots", "indexmap", "log", "num-traits 0.2.17", "petgraph", "pp-rs", + "ron", + "rspirv", "rustc-hash", "serde", - "spirv", + "spirv 0.2.0+1.5.4", "termcolor", "thiserror", "unicode-xid", ] +[[package]] +name = "naga-cli" +version = "0.14.0" +dependencies = [ + "argh", + "bincode", + "codespan-reporting", + "env_logger", + "log", + "naga", +] + [[package]] name = "nanorand" version = "0.7.0" @@ -1848,6 +2066,21 @@ dependencies = [ "getrandom 0.2.10", ] +[[package]] +name = "nanoserde" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a983d0b19ed0fcd803c4f04f9b20d5e6dd17e06d44d98742a0985ac45dab1bc" +dependencies = [ + "nanoserde-derive", +] + +[[package]] +name = "nanoserde-derive" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4dc96541767a4279572fdcf9f95af9cc1c9b2a2254e7a079203c81e206a9059" + [[package]] name = "ndk" version = "0.7.0" @@ -1915,7 +2148,7 @@ dependencies = [ "bitflags 1.3.2", "cfg-if", "libc", - "memoffset", + "memoffset 0.6.5", ] [[package]] @@ -1928,7 +2161,7 @@ dependencies = [ "bitflags 1.3.2", "cfg-if", "libc", - "memoffset", + "memoffset 0.6.5", ] [[package]] @@ -2139,6 +2372,12 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +[[package]] +name = "oorandom" +version = "11.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" + [[package]] name = "orbclient" version = "0.3.46" @@ -2281,6 +2520,34 @@ dependencies = [ "winit 0.28.7", ] +[[package]] +name = "plotters" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" +dependencies = [ + "num-traits 0.2.17", + "plotters-backend", + "plotters-svg", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "plotters-backend" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" + +[[package]] +name = "plotters-svg" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" +dependencies = [ + "plotters-backend", +] + [[package]] name = "pmutil" version = "0.6.1" @@ -2452,6 +2719,26 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" +[[package]] +name = "rayon" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + [[package]] name = "redox_syscall" version = "0.3.5" @@ -2517,6 +2804,15 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "rspirv" +version = "0.11.0+sdk-1.2.198" +source = "git+https://github.com/gfx-rs/rspirv?rev=b969f175d5663258b4891e44b76c1544da9661ab#b969f175d5663258b4891e44b76c1544da9661ab" +dependencies = [ + "rustc-hash", + "spirv 0.2.0+sdk-1.2.198", +] + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -2581,6 +2877,15 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scoped-tls" version = "1.0.1" @@ -2828,6 +3133,15 @@ checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" dependencies = [ "bitflags 1.3.2", "num-traits 0.2.17", + "serde", +] + +[[package]] +name = "spirv" +version = "0.2.0+sdk-1.2.198" +source = "git+https://github.com/gfx-rs/rspirv?rev=b969f175d5663258b4891e44b76c1544da9661ab#b969f175d5663258b4891e44b76c1544da9661ab" +dependencies = [ + "bitflags 1.3.2", ] [[package]] @@ -2980,6 +3294,16 @@ dependencies = [ "strict-num", ] +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -3205,6 +3529,16 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" diff --git a/Cargo.toml b/Cargo.toml index 114b4eb24c..2123e89e75 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,27 +3,33 @@ resolver = "2" members = [ "cts_runner", "deno_webgpu", - "player", + + # default members "examples/*", - "wgpu", + "naga", + "naga-cli", + "player", + "tests", "wgpu-core", "wgpu-hal", "wgpu-info", "wgpu-macros", "wgpu-types", - "tests", + "wgpu", ] exclude = [] default-members = [ "examples/*", + "naga", + "naga-cli", "player", - "wgpu", + "tests", "wgpu-core", "wgpu-hal", "wgpu-info", "wgpu-macros", "wgpu-types", - "tests", + "wgpu", ] [workspace.package] @@ -52,8 +58,7 @@ path = "./wgpu-hal" version = "0.18.0" [workspace.dependencies.naga] -git = "https://github.com/gfx-rs/naga" -rev = "92e41b43e437146b5d946eb238de963be1168016" +path = "./naga" version = "0.14.0" [workspace.dependencies] @@ -161,7 +166,6 @@ tokio = "1.33.0" termcolor = "1.3.0" [patch."https://github.com/gfx-rs/naga"] -#naga = { path = "../naga" } [patch."https://github.com/zakarumych/gpu-descriptor"] #gpu-descriptor = { path = "../gpu-descriptor/gpu-descriptor" } @@ -170,7 +174,6 @@ termcolor = "1.3.0" #gpu-alloc = { path = "../gpu-alloc/gpu-alloc" } [patch.crates-io] -#naga = { path = "../naga" } #glow = { path = "../glow" } #d3d12 = { path = "../d3d12-rs" } #web-sys = { path = "../wasm-bindgen/crates/web-sys" } diff --git a/naga/cli/Cargo.toml b/naga-cli/Cargo.toml similarity index 97% rename from naga/cli/Cargo.toml rename to naga-cli/Cargo.toml index 00581905f2..e5b19a1065 100644 --- a/naga/cli/Cargo.toml +++ b/naga-cli/Cargo.toml @@ -18,7 +18,7 @@ argh = "0.1.5" [dependencies.naga] version = "0.14" -path = "../" +path = "../naga" features = [ "validate", "compact", diff --git a/naga/cli/src/bin/naga.rs b/naga-cli/src/bin/naga.rs similarity index 100% rename from naga/cli/src/bin/naga.rs rename to naga-cli/src/bin/naga.rs diff --git a/naga/.github/CODEOWNERS b/naga/.github/CODEOWNERS deleted file mode 100644 index 312b7e1bff..0000000000 --- a/naga/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @gfx-rs/naga diff --git a/naga/Cargo.toml b/naga/Cargo.toml index c74a8cd861..3fc2b307a6 100644 --- a/naga/Cargo.toml +++ b/naga/Cargo.toml @@ -15,12 +15,6 @@ rust-version = "1.65" [package.metadata.docs.rs] all-features = true -[profile.release] -panic = "abort" - -[profile.dev] -panic = "abort" - [features] default = [] clone = [] @@ -78,11 +72,3 @@ ron = "0.8.0" rspirv = { version = "0.11", git = "https://github.com/gfx-rs/rspirv", rev = "b969f175d5663258b4891e44b76c1544da9661ab" } serde = { version = "1.0", features = ["derive"] } spirv = { version = "0.2", features = ["deserialize"] } - -[workspace] -members = [".", "cli"] - -# Include "cli", so that `cargo run` runs the CLI by default. Include ".", so -# that `cargo test` includes naga's own tests by default (but note, using the -# features that `cli/Cargo.toml` requests). -default-members = [".", "cli"] diff --git a/naga/LICENSE-APACHE b/naga/LICENSE-APACHE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/naga/LICENSE-APACHE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/naga/LICENSE-MIT b/naga/LICENSE-MIT deleted file mode 100644 index 58acb754a2..0000000000 --- a/naga/LICENSE-MIT +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) [yyyy] [name of copyright owner] - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/naga/codecov.yml b/naga/codecov.yml deleted file mode 100644 index 959972a69c..0000000000 --- a/naga/codecov.yml +++ /dev/null @@ -1 +0,0 @@ -comment: false \ No newline at end of file diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index 755d350825..6ad0bedf72 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -79,8 +79,7 @@ smallvec = "1" thiserror = "1" [dependencies.naga] -git = "https://github.com/gfx-rs/naga" -rev = "92e41b43e437146b5d946eb238de963be1168016" +path = "../naga" version = "0.14.0" features = ["clone", "span", "validate"] diff --git a/wgpu-hal/Cargo.toml b/wgpu-hal/Cargo.toml index 0bb8ebed84..813fc70122 100644 --- a/wgpu-hal/Cargo.toml +++ b/wgpu-hal/Cargo.toml @@ -165,15 +165,13 @@ libc = "0.2" android_system_properties = "0.1.1" [dependencies.naga] -git = "https://github.com/gfx-rs/naga" -rev = "92e41b43e437146b5d946eb238de963be1168016" +path = "../naga" version = "0.14.0" features = ["clone"] # DEV dependencies [dev-dependencies.naga] -git = "https://github.com/gfx-rs/naga" -rev = "92e41b43e437146b5d946eb238de963be1168016" +path = "../naga" version = "0.14.0" features = ["wgsl-in"]