Import Tint changes from Dawn

  - 262a4c482473dea0d0b0263410f98af812f169aa tint: More doxygen fixes by Ben Clayton <>
  - 05caf3a20f18ada629ce818d92b0022bef41541d tint: Fix doxygen errors by Ben Clayton <>
  - 7eaab385749870704ff3ae7f831740cb5b0c3194 tint: Simplify backend Sanitize functions by passing in O... by Antonio Maiorano <>
  - a7230f06ff67d804f5d6cefad175cabc1f066e57 tint: Standardize the way we forward-declare by Ben Clayton <>
  - 30353998c142badf50c38d1bd538c13a5a8d35c5 tint: Fix copy instead of move of ArrayLengthFromUniform:... by Antonio Maiorano <>
  - 81e497c45f5fe67ca43f9ed3567f7ac958df1800 tint: handle CRLF on Windows when splitting WGSL source by Antonio Maiorano <>
  - 4d36557bcea70269f3492a5e65367e59e6ee2b1c Normalize all line endings to LF by Ben Clayton <>
  - 9d27aaaaa1e2d5bc7ee596eb11ab91db7af51aa3 Always use 0 for the Depth operand of OpTypeImage by Jiawei Shao <>
  - 9e9db88e329efbd8de0a93c0f73d7a53ec10b9e7 Minor formatting changes. by dan sinclair <>
  - 8155b9dada070a01b8a2f97b6e07782beaa7a1fc Condense namespaces in tint/. by dan sinclair <>
  - 612a59be41404006d0c444841edd7314ccd602f4 Condense namespaces in tint/reader. by dan sinclair <>
  - 258cbafdec5f6ee0acf3772e573029bba73b0601 Condense namespaces in tint/reader/spirv. by dan sinclair <>
  - 34323ac069928e9afd88e5b2d1e98461a7dc19a7 Condense namespaces in tint/ast. by dan sinclair <>
  - aba5a212ca73c71673f6e2d32226402bdcabb646 Condense namespaces in tint/inspector. by dan sinclair <>
  - ebfbaf8f22a6113bdc62c54114b94d6ad2a4cf67 Add top-level OWNERS and scope Tint owners more tightly. by Corentin Wallez <>
  - 30a03d9eedb603c1244c4292d786fa3cdb259d69 Condense namespaces in tint/reader/wgsl. by dan sinclair <>
  - 62a1d7104f4e46e9010818e8d4f3769b063016f1 Condense namespaces in tint/fuzzers. by dan sinclair <>
  - d209379cd1cb9e567b4faf0dfc2d2f8db2fad60b Condense namespaces in tint/resolver. by dan sinclair <>
  - 7bc9ba13bdc1f5c1aa2e889113af8ac71abae786 Condense namespaces in tint/diagnostic. by dan sinclair <>
  - fe4bfd45fe46024f87ab372fc85dcab36cc1068c Condense namespaces in tint/utils. by dan sinclair <>
  - b5599d35f96f4b6d5ab57ed2d2791ed7b9d7e971 Condense namespaces in tint/transform. by dan sinclair <>
  - bb19d4a24b8326d278f61e68c6a09a3411e7cdde spirv: Remove AssembleFailure() tests by Antonio Maiorano <>
  - c990b3c867fffc203d16aab4315a3a40d5cd246d Condense namespaces in tint/sem. by dan sinclair <>
  - 67e79fe506fd873b28a0008b142608e7015329c6 Condense namespaces in tint/writer. by dan sinclair <>
  - c05f045df48a7a82063b9c4eaa19b91fa92468aa Condense namespaces in tint/val by dan sinclair <>
  - 5d590591ef2290864b79aa0c4ba9fa10a0d42641 Condense namespaces in tint/writer/glsl. by dan sinclair <>
  - 6a5bef19121f16345c57f8eee293992ae372b841 Condense namespaces in tint/writer/hlsl. by dan sinclair <>
  - 411d065e2e56bf53eb16ffa2f46a8b31a54a2292 Condense namespaces in tint/writer/spirv. by dan sinclair <>
  - 9fe8260dbb9833dcb44663b1a5fb6002f78f3598 Condense namespaces in tint/writer/msl. by dan sinclair <>
  - d68d3a9809c1bcaecb89db1400fba66540abbdb5 Add support for increment/decrement statements by James Price <>
  - b02fe31e469d4cc2dcc504cda023c54f23557db1 wgsl: Add support for increment/decrement statements by James Price <>
  - 2f9e31cefb5b7b8cdec5dc60a7bed59ac40ee348 resolver: Validate increment/decrement statements by James Price <>
  - ebe9741d0c0df1e31c21c8cb79b870510a3ee844 ast: Add an IncrementDecrementStatement node by James Price <>
  - b28d6c8e1c5288d9a4ec2e0a910a66c435b532b1 Remove lintcpp from presubmits since it fails on all Dawn... by Corentin Wallez <>
  - 9f54a51b3d0f86cdb1516183a57d4d985efa4fe9 Condense namespaces in tint/writer/wgsl. by dan sinclair <>
  - e72e42d9e0c851311512ca6da4d7b59f0bcc60d9 Add Tint's .clang-format file to src/tint by James Price <>
GitOrigin-RevId: 262a4c482473dea0d0b0263410f98af812f169aa
Change-Id: I91a1c735b94529f190ae4c34b40c486457dcfc0e
Reviewed-by: Dan Sinclair <>
Reviewed-by: Ryan Harrison <>
Kokoro: Kokoro <>
Commit-Queue: Ben Clayton <>
1017 files changed
tree: c2f449d044894a81e31baec0cd233686b8c2a28b
  1. .vscode/
  2. build_overrides/
  3. docs/
  4. include/
  5. infra/
  6. kokoro/
  7. src/
  8. test/
  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.