commit | 621ba9c19f039fbec0e322b947cfcdad599adae7 | [log] [tgz] |
---|---|---|
author | Tint team <no-reply@google.com> | Sun Jul 02 22:52:47 2023 +0000 |
committer | Tint LUCI CQ <tint-scoped@luci-project-accounts.iam.gserviceaccount.com> | Sun Jul 02 22:52:47 2023 +0000 |
tree | 0f1f3d27eaa4c357d00ad3de3a3080ac17608c85 | |
parent | 92af2aa218099de7ad80b166d772da29540e2b9c [diff] |
Import Tint changes from Dawn Changes: - 7171205a3fc23f5d7a8f971bf551ebc3adb2498c [ir][spirv-writer] Implement any builtin by James Price <jrprice@google.com> - 6a9d6a021dee9469dcbae0f819ee2bdfedd5b06d [ir][spirv-writer] Implement derivative builtins by James Price <jrprice@google.com> - fb1f96662716af04e17578d5d8fd591bfd61f5e9 [ir][spirv-writer] Implement binary modulo by James Price <jrprice@google.com> - 08c60a6417096d86a6fa05e3d0a5ee02056ab72a [ir][spirv-writer] Emit bitcast instructions by James Price <jrprice@google.com> - 5bc6329cca4eb7979a6105fc0f906b5bb88596db [ir][spirv-writer] Implement shift operations by James Price <jrprice@google.com> - a5e7e951a6168082f7f15b39b99e91db0bb6b26b [tint][ir][tint_ir_roundtrip_fuzzer] Emit WGSL output on ... by Ben Clayton <bclayton@google.com> - 2c298188fba80df81201b555e7c576c4332f0ba8 [tint][it][ToProgram] Correctly handle pointers by Ben Clayton <bclayton@google.com> - 9cea3ca1b5184a08d2e1da28c90d3c0577671e83 [ir][spirv-writer] Implement cross builtin by James Price <jrprice@google.com> - ab33ce93944a14ff4d7c75ffb342facc45c74c16 [ir][spirv-writer] Implement unary instructions by James Price <jrprice@google.com> - 737e156a08ecc9f741c6ac573600da393304eb83 [ir][spirv-writer] Implement trig builtins by James Price <jrprice@google.com> - aeae6a3fd8194b6fb921b44630885cd3b1070bb3 [ir][spirv-writer] Implement length builtin by James Price <jrprice@google.com> - 37111a36b64d72d493ab0e66a382f6e9f8a81d07 [ir][spirv-writer] Implement normalize builtin by James Price <jrprice@google.com> - 8558e4873b86783d89404300487f3e41bc854856 [ir][spirv-writer] Implement convert instructions by James Price <jrprice@google.com> - e04cdec79537b9f577065e00c0e44e4fedf2fa0f [tint][ir] Fix new validation failures by Ben Clayton <bclayton@google.com> - 27577970ea28d378a6a91a8f4dab5bfd44750205 [ir] Hookup IR to test runner by dan sinclair <dsinclair@chromium.org> - e94b9bc4864c36a489df832154aac4a829276205 [ir][spirv-writer] Implement distance builtin by James Price <jrprice@google.com> - fb89ee855e16bbce7746ab5cead2594f8e65f6de [ir][spirv-writer] Implement clamp builtin by James Price <jrprice@google.com> - 74c9a5acd7d216f513679358c8b721b6c1bdb1e0 [ir][spirv-writer] Implement multiply by James Price <jrprice@google.com> - 1074388b2d729f4a0fa6950dba53031fcc5cb457 [ir][spirv-writer] Implement divide by James Price <jrprice@google.com> - 7fbc40d4bf9c63076cb85ec848eca7af2766defe [ir][spirv-writer] Emit swizzle instructions by James Price <jrprice@google.com> - 8b64bd7619566c1e46782afa633691857beb74e6 [ir][spirv-writer] Emit texture and sampler vars by James Price <jrprice@google.com> - b12e7191984babddbb44e0696d1e038b350d8930 [ir][spirv-writer] Emit texture and sampler types by James Price <jrprice@google.com> - 33ef3da827b96aaae481197b8b51edd583f67dda [ir] Fix ToProgram tests by James Price <jrprice@google.com> - 2e8692c9e3d6859167c10f7b2a1e1332b79db33e [tint][ir][ToProgram] Emit builtin calls by Ben Clayton <bclayton@google.com> - d97942b4360769169f64a119e2e55d6afac5800d [tint][ir][ToProgram] Emit var binding attributes by Ben Clayton <bclayton@google.com> - d95359f2d8f0161a0340b9ffbecf01624905a661 [tint][ir] Fix indexing of abstract typed constants by Ben Clayton <bclayton@google.com> - cc4e27acadd2bde663d40d2d4472e907aece17db [tint][ir][ToProgram] Validate before emitting. by Ben Clayton <bclayton@google.com> - faadfb1d93c2aede8a4e3645394ae44384bb4d56 [ir][validation] Walk through if/switch/loop in the valid... by dan sinclair <dsinclair@chromium.org> - e9cd719e224eefafd9e16e6bd18750d723d11214 [ir][spirv-writer] Rework remaining unit tests by James Price <jrprice@google.com> - fec334a929ebd13dd20b44cae6eee309758783f1 [ir][spirv-writer] Emit OpUndef when needed by James Price <jrprice@google.com> - 96cac41fe99e292e5e719743617bdff3acb5e2a3 [ir][spirv-writer] Fix block labels for loop phis by James Price <jrprice@google.com> - cf2bdc0ed8caa689a380d744cc827947ec43d018 [tint][ir][ToProgram] Implement Convert by Ben Clayton <bclayton@google.com> - e17da01c3a775f1c37ec63c6d2ea2aecc9547fb3 [tint][ir][ToProgram] Implement Access by Ben Clayton <bclayton@google.com> - 271d21552251c5dfdd50e0c6c008261edff3630f [tint][ir][ToProgram] Implement Construct by Ben Clayton <bclayton@google.com> - a83202be6973e9e6ea2e3396199b50febd50ba09 [tint][ir][ToProgram] Add var<private>, more types. by Ben Clayton <bclayton@google.com> - 10550d67dc682a79b8e9ab21c113d9fa9ceaa13f [tint][ir] Add roundtrip fuzzer by Ben Clayton <bclayton@google.com> - 8232b503e3a2184f7ee60be6d4696ae7b6336138 [tint][ir] static_assert on non-deterministic instruction... by Ben Clayton <bclayton@google.com> - 13d96766f785dd4118bc8aa86e22fcd05085077f Fixup syntax tree build. by dan sinclair <dsinclair@chromium.org> GitOrigin-RevId: 7171205a3fc23f5d7a8f971bf551ebc3adb2498c Change-Id: I392f2a3160af84b3b9ab42b3345e4a4f5aca811a Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/139780 Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: Ben Clayton <bclayton@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
Note: This repo is read-only, minimized mirror of the Dawn repo.
Tint changes should be made in the Dawn repo.
Tint is a compiler for the WebGPU Shader Language (WGSL).
This is not an officially supported Google product.
TINT_BUILD_SPV_READER
: enable the SPIR-V input reader (off by default)TINT_BUILD_WGSL_READER
: enable the WGSL input reader (on by default)TINT_BUILD_SPV_WRITER
: enable the SPIR-V output writer (on by default)TINT_BUILD_WGSL_WRITER
: enable the WGSL output writer (on by default)TINT_BUILD_FUZZERS
: enable building fuzzzers (off by default)Tint uses Chromium dependency management so you need to install depot_tools and add it to your PATH.
# Clone the repo as "tint" git clone https://dawn.googlesource.com/tint tint cd tint # Bootstrap the gclient configuration cp standalone.gclient .gclient # Fetch external dependencies and toolchains with gclient gclient sync
mkdir -p out/Debug cd out/Debug cmake -GNinja ../.. ninja # or autoninja
mkdir -p out/Debug cd out/Debug cmake ../.. make # -j N for N-way parallel build
mkdir -p out/Debug gn gen out/Debug autoninja -C out/Debug
If you are attempting fuzz, using TINT_BUILD_FUZZERS=ON
, the version of llvm in the XCode SDK does not have the needed libfuzzer functionality included.
The build error that you will see from using the XCode SDK will look something like this:
ld: file not found:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/lib/darwin/libclang_rt.fuzzer_osx.a
The solution to this problem is to use a full version llvm, like what you would get via homebrew, brew install llvm
, and use something like CC=<path to full clang> cmake ..
to setup a build using that toolchain.
The gn based work flow uses the Chromium toolchain for building in anticipation of integration of Tint into Chromium based projects. This toolchain has additional plugins for checking for style issues, which are marked with [chromium-style] in log messages. This means that this toolchain is more strict then the default clang toolchain.
In the future we will have a CQ that will build this work flow and flag issues automatically. Until that is in place, to avoid causing breakages you can run the [chromium-style] checks using the CMake based work flows. This requires setting CC
to the version of clang checked out by gclient sync
and setting the TINT_CHECK_CHROMIUM_STYLE
to ON
.
mkdir -p out/style cd out/style cmake ../.. CC=../../third_party/llvm-build/Release+Asserts/bin/clang cmake -DTINT_CHECK_CHROMIUM_STYLE=ON ../../ # add -GNinja for ninja builds
Please file any issues or feature requests at https://bugs.chromium.org/p/tint/issues/entry
Please see the contributing guide in the Dawn repo.