Import Tint changes from Dawn

  - b3741f50362bec2b745f8229e0500218ed2d73d4 Add missing doc comment. by dan sinclair <>
  - b02535557e29ec15018e7a062b79716b1169c9ef Fixup build/include_order issues in src/dawn. by dan sinclair <>
  - bb62ef0d2c0f05f88024b9c384d8e8e5c76787b2 [tint] Split sem methods to a helper. by dan sinclair <>
  - f0469eb65a3432b4825447c134f65c8bf583d40d Update tools/format by dan sinclair <>
  - a1f13f8bada092a0a3da3ac3fa90949359aabd82 [tint] Make most Validate methods const. by dan sinclair <>
  - 0c3e5a081372774faaffd59f4b7267677db574b1 [tint] Pass the valid layout storage into ValidateStorage... by dan sinclair <>
  - d431eb9d94fdae9c152d988e869a810e4556ecfb [tint] Move potential type creation out of ValidateReturn. by dan sinclair <>
  - 5d4cac1da1ecc3587ef79002e2f097665201731c [tint] Remove current_function from ValidateReturn. by dan sinclair <>
  - 8c67fec731b39b81508caafc9f7e1bddc0546e6f [tint] Remove current_function from ValidateFunction. by dan sinclair <>
  - d382e20b00681db6c1b5c1335d12fdd26972235e [tint] Remove current_function from ValidateStructure. by dan sinclair <>
  - 3dbeb8b7a56d064187c92fc5d94f56d33a8b5cb8 [tint] Remove current_function from ValidateEntryPoint. by dan sinclair <>
  - 98b19374b4817747d75679c727947ed663476ef9 [tint] Remove current_function_ from ValidateBuiltinAttri... by dan sinclair <>
  - 94c2c2d44c7bbfbccad14d6230c3ca09800426ad [tint] Remove current_function_ usage from ValidateLocati... by dan sinclair <>
GitOrigin-RevId: b3741f50362bec2b745f8229e0500218ed2d73d4
Change-Id: I2ef9de5379bfc35aa7691d97a6d40c5cd8248426
Reviewed-by: Ben Clayton <>
Kokoro: Kokoro <>
Commit-Queue: Ben Clayton <>
10 files changed
tree: da77b7527b6bc420bbb70ce5a6da888197145993
  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.