Import Tint changes from Dawn

  - 4b35f52f9b33eb358a01170ad2fd334f2b5b4347 [ir] Remove IsConnected by dan sinclair <>
  - a00fe39f3e823ad38aeb2c575daf94848977a961 [ir] Remove FlowNode. by dan sinclair <>
  - 0eb4d04d83e8f1565e9dc527f6d84fdbc0268aa8 [ir][spirv-writer] Expand binary arithmetic tests by James Price <>
  - dd7b3141052053ce7e83057b6f82e4da9ec846af [ir][spirv-writer] Emit binary bitwise operators by James Price <>
  - 59339216a1f625bce1eded49022c286e1cd53aa3 [ir][spirv-writer] Emit comparison instructions by James Price <>
  - 1e67e5368d30d5c0ea8669b9c254f03ad86617f0 [tint][constant] Use the new constant::Manager by Ben Clayton <>
  - a71bd22de1263cbf5e7774e0abad9653b77cec42 [tint][constant] Make Value::Clone() return a const pointer by Ben Clayton <>
  - 9aa8012d91e5603650532ad1bd90f8d38b3583e2 [tint][constant] Add constant::Manager by Ben Clayton <>
  - 56e5fb57ef241ce5c9937faacf64d792bccd5856 [ir] Convert function to Value. by dan sinclair <>
  - a518707db4a6d785ce82ea359b9f0a8d426937e3 [ir] Update disassembly output. by dan sinclair <>
  - f55ef5e48b14121017d315aa4c18c4b3e58c61a1 [ir] Convert FlowNode to Block where possible. by dan sinclair <>
  - 0089d5e6e2f9915b8867f68b758c8b467e2116b4 [ir] Change base class for terminators. by dan sinclair <>
  - e9a4adeff959518ee876ee61734c93967ed906e8 [ir] Remove Jump. by dan sinclair <>
  - 24c5ed6b0a5ab8ad7b5f708fa6f89dd1ac777e07 [ir][spirv-writer] Emit matrix constants by James Price <>
  - a8c528052d67f37b9a1e7c7cb9a4e10d927e065b [ir][spirv-writer] Emit matrix types by James Price <>
  - b54b58d57df2e26e0b6dd8aa87e730b1f7f818f8 [ir][spirv-writer] Implement user function calls by James Price <>
  - c1fd6316de4817f1d1a5caef97a5623e384e472c [fuzzers] Substitute all override variables by James Price <>
  - 1ea7f0f351856153e7f51b7a2695da658df38600 [ir][spirv-writer] Add support for parameters by James Price <>
  - f5a62539f4ea16999fbdac588793aa3a47f0d8b0 [ir][spirv-writer] Add support for return values by James Price <>
  - 23c0451377ec6c31c5d5b898595d860b605992de [ir] Add scalar type helpers to type::Manager by James Price <>
GitOrigin-RevId: 4b35f52f9b33eb358a01170ad2fd334f2b5b4347
Change-Id: I7b21e9697ef4855fefaac7fa557cc341d6b495f4
Commit-Queue: Ben Clayton <>
Kokoro: Kokoro <>
Reviewed-by: Ben Clayton <>
70 files changed
tree: 9d9459bde9edc2d1f66fa3e722d0054956957dbb
  1. .vscode/
  2. build_overrides/
  3. docs/
  4. include/
  5. infra/
  6. kokoro/
  7. scripts/
  8. src/
  9. third_party/
  10. tools/
  11. .clang-format
  12. .gitignore
  13. .gn
  16. CMakeLists.txt
  17. CMakeSettings.json
  19. CPPLINT.cfg
  20. DEPS
  21. Doxyfile
  23. OWNERS
  26. standalone.gclient
  27. tint_overrides_with_defaults.gni


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.


  • Git
  • CMake (3.10.2 or later)
  • Ninja (or other build tool)
  • Python, for fetching dependencies
  • depot_tools in your path

Build options

  • 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.

Getting source & dependencies

# Clone the repo as "tint"
git clone tint
cd tint

# Bootstrap the gclient configuration
cp standalone.gclient .gclient

# Fetch external dependencies and toolchains with gclient
gclient sync

Compiling using CMake + Ninja

mkdir -p out/Debug
cd out/Debug
cmake -GNinja ../..
ninja # or autoninja

Compiling using CMake + make

mkdir -p out/Debug
cd out/Debug
cmake ../..
make # -j N for N-way parallel build

Compiling using gn + ninja

mkdir -p out/Debug
gn gen out/Debug
autoninja -C out/Debug

Fuzzers on MacOS

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/

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.

Checking [chromium-style] issues in CMake builds

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


Please see the contributing guide in the Dawn repo.