Import Tint changes from Dawn

  - 0ce9ab042ef5896b57833dd73dfa19fc94973b13 tint: Change all ProgramBuilder literals to 'i' or 'u' su... by Ben Clayton <>
  - f7357f89a38a95bed97612f417100214a273b23f tint: Castable - support non-default-constructable return... by Ben Clayton <>
  - c188ca62ca3ec311cbcf00e96ba0ebd0d7800ebe tint: add --overrides flag to specify pipeline overrides by Antonio Maiorano <>
  - d3921b8230101c802c4fefb9c45a5bab9c503cdc Fixes for C++20 support. by Peter Kasting <>
  - 7cbd8202e6715ee5d51314bd1e745a5243da82c1 tint: Add Bitcast helper by Ben Clayton <>
  - 26cba1cb3925a46e2be60656d2e407e10ce243a1 tint: Fix CFI error in BlockAllocator by Ben Clayton <>
  - 06496d4d1a77cc3843fbdaeef1340244c77bd23a tint/reader/spirv: Generate 'i' suffixed literals by Ben Clayton <>
  - 8822e2966acf3b7fc0b222af7bad6ef4bcdc597f tint: Merge [S|U]intLiteralExpression by Ben Clayton <>
  - f693488bff822ac29a9cd4d0c62a0c94fe745619 tint: Lex three types of integer literal by Ben Clayton <>
  - e55877d017ef99cb1edf7301e53df116c1994f85 tint: Chromium-style fixes by Ben Clayton <>
  - b3aab0965214e10efea7a5d6fe7e014cb8252a69 AST fuzzer: Change unary expression operator by Author: Shiyu Liu <>
  - 507a671e7d84fda9a5d34580bcce4eb235f5acf5 tint: Fix indentation in code templates by Ben Clayton <>
  - e23283f4974df5b1465f424dde10a5675aba7ab8 tint: Fix `[chromium-style]` auto pointer warnings by Ben Clayton <>
  - 4e98fb0bd8c99ac7cc91f7157428f645099b86d3 Factor out code to flatten bindings for msl by Antonio Maiorano <>
  - 8aff0ed684cd140a6dd010b95ceac1decb734f74 tint: Add ProgramBuilder::Else() helper by James Price <>
  - 41e4d9a34c1d9dcb2eef3ff39ff9c1f987bfa02a Consistent formatting for Dawn/Tint. by dan sinclair <>
  - 41cbf0279c46f66aee1ca50c13c15fa23db753ff Reland ExternalTexture Gamma/Gamut Correction by Brandon Jones <>
  - 9432887ce845063ff1ffa5b6c90fb3e5ac94a3ba tint/sem: Add abstract int and float types by Ben Clayton <>
  - 26ebe5ec3644decb5d47d64580d50ab80a7c8c64 tint: Refactor if-else statement representation by James Price <>
  - 01004b7732abf4e2587a7d560828e49156ca6633 tint: Remove '_type' suffix from file names by Ben Clayton <>
  - 7e8df044c6506297cc830f3b34c6bd391c8791e5 tint/writer/spirv: Replace Operand with std::variant by Ben Clayton <>
  - 617570a7da4a30d4277f84f6c58f7d851114e47e tint/writer: Replace scope_stack_, fix type ctor scoping. by Ben Clayton <>
  - e85fe161cdaf2c464149a5a9d273437a3998c8e1 tint: ProgramBuilder: Rename Const() to Let() by Ben Clayton <>
  - 046abc08e850c95a6573bdeac6601ecf21f66ec5 tint/writer: Replace use of strings for cache keys by Ben Clayton <>
  - f7ec85f9bd532918a982b5130aa311c39bb4dab2 Rename UniformConstant to Handle. by dan sinclair <>
  - 6bdd6592d9becdc5886c4c4f4487e849bfabc5e7 DEPS: Update Dawn standalone toolchains by Ben Clayton <>
  - 3b1e30a496e3b1e2ea92d37a84190fa0596f9948 tint: Add `i` suffix and validate UInt literal non-negative by Zhaoming Jiang <>
  - 7098d3d692827ed973564c5e2371ee77ffbfb0d9 tint: Add enable directive for extensions by Zhaoming Jiang <>
  - d3a5080c7bf8be17fce355a5f60223ab8271ece4 Fixup validator tests added during split from resolver. by dan sinclair <>
  - 1d882f55b7f47dd06fe57efdf286100bf2a3ad6b Revert "Add External Texture Gamma/Gamut Correction" by Ben Clayton <>
  - f4a861dd60b9e5f89b31a5690cf01c47b11a5326 tint/fuzzers: Build protobufs after remove_stale_autogen_... by Ben Clayton <>
  - b52d740227043bc3e07dca0a98778b16d959eaea D3D12: Indirect validation shader name cleanup and parame... by Enrico Galli <>
  - 857175e59b39e42fd21092fd4a96af9ea2c30297 Add External Texture Gamma/Gamut Correction by Brandon Jones <>
  - 67af2087583562f19ced01d659af7c6d4bda138a GN: Move dawn import into build_with_chromium cond by Ben Clayton <>
  - 25775308a98aef286d7d8ff2b62bd316beff8ed7 Implement support for Unicode Pattern_White_Space by Antonio Maiorano <>
  - 790e4c2d60ffba5a0c20f209c94cdcdaa8bbd3d1 GLSL writer: emit gl_PointSize = 1 in all vertex shaders ... by Stephen White <>
  - e6d7ea708a960a3fbc775ff3a5bcfb4c6a0b1043 tint: Use resolved source var in the Inspector by James Price <>
  - a9d8da4434efb043b8ad00ac0c2628f2ff44c209 tint: Use resolved source var in LocalizeStructArrayAssig... by James Price <>
  - 98eb1696920974aa18b960efb96a00ad4e7b2cce tint: Track originating variables in the resolver by James Price <>
  - eba0e85c335c5b55b03f5dfa9f37501b1959e7a2 tint: make Lexer use line breaks from Source::File by Antonio Maiorano <>
  - a238e7bf9d639da9f8ce941cf58b3b7c2e6deef9 tint_generator_wgsl_corpus should wait for remove_stale_a... by Fumitoshi Ukai <>
  - aacad7c65e80fdc1517348a5a4e7000ecec57d2e tint: Update FirstIndexOffsetTest expected results by James Price <>
  - 6cb57a9847f591b9ff53db529fb659098ddb4770 Change External Texture YUV-to-RGB Conversion to Use Matrix by Brandon Jones <>
  - f05575bb21584fda1e8e174470348c8d1679cf80 [tint] Move validation code into a Validator class. by dan sinclair <>
  - 45ec7c352815154142de230588a769537da09389 D3D12: Duplicate first/baseVertex on Draw[Indexed]Indirect by Enrico Galli <>
GitOrigin-RevId: 0ce9ab042ef5896b57833dd73dfa19fc94973b13
Change-Id: Ia8280f68ae3b4e53f42372ebc7d8e2db91ed1ada
Reviewed-by: Ben Clayton <>
Commit-Queue: Ben Clayton <>
Kokoro: Kokoro <>
1133 files changed
tree: 17d9c4d7be9024c1affe07d8419269a8b78f16ee
  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.