Import Tint changes from Dawn

Contains a manual fix for GN builds (adding 'tint_build_tintd' definition)

Changes: - 27f0080bbe19e7be70257d6cd4dcc3867e5781b6 [tintd] Implement lsp::TextDocumentSignatureHelpRequest by Ben Clayton <>
  - 2f215d1b7844f59c05a2dbb270815f5055da9c18 [tintd] Simplify installation by Ben Clayton <>
  - 369d8cdfc497c0ed2f47662c273ea1cd38844893 [tintd] Implement lsp::TextDocumentInlayHintRequest by Ben Clayton <>
  - 43dabe99b4d6c4bd4ccbfc1a4495a68f2135ea57 [tintd] Implement lsp::TextDocumentSemanticTokensFullRequ... by Ben Clayton <>
  - ef02c4cb844521cef32af3d5a03cd7b94774d30a [tintd] Implement lsp::TextDocument[Prepare]RenameRequest by Ben Clayton <>
  - aace4808de8332fbd96e23ada9feb28cff7a3108 [tintd] Stub required notifications by Ben Clayton <>
  - 82ac0fd8baab81192ed83c0db3d907e72c12f528 Mark dp4a methods as `@const` in core.def. by dan sinclair <>
  - 06821eba8a7bdca9240c599ea9de376736cb2fa5 Re-enable disabled test. by dan sinclair <>
  - 1617031fad9a06afeb5ec261bac8e50d9ce78619 Change emitted name for `StageAttribute`. by dan sinclair <>
  - f3b93c1b2da8c55aacb49cb0763e6fcf666a8ff1 Add FoldConstants transform by dan sinclair <>
  - 2366f480a965d3faa74c655d32781665b719a606 [tintd] Implement lsp::TextDocumentHoverRequest by Ben Clayton <>
  - 841ca1a590932d341e21ba46b7ecb21e3b60e841 Fix clang-tidy misc-include-cleaner complaints by David Neto <>
  - c00db02cbbfedcc03ce23a2f237468d1405a5cda [tint][ir] Skip unreachable continuing blocks by James Price <>
  - 4176d450acf1e163378e2ca40325b82479c4dcdf [ir] Emit unreachable for loop body exits by James Price <>
  - 02a5e844e0baf819b6c28063d5fdb77831794ef9 [spirv] Fix unreachable handling in MergeReturn by James Price <>
  - c69f7695fc76ad93f44dc5c8653af1e365bf4559 [tintd] Implement TextDocumentReferencesRequest by Ben Clayton <>
  - ee9f1f67b860f424787ff174363f627aa2ebf41f [tintd] Implement TextDocumentDefinitionRequest by Ben Clayton <>
  - 7b1819b647abd1dd097fa62db85ed023998793ea [tintd] Implement TextDocumentDocumentSymbolRequest by Ben Clayton <>
  - 3f05fea94ec7aa785921b4b095f610bcbca20588 [tintd] Implement basic document handling. by Ben Clayton <>
  - b827111c8e489e61b0971232b0da133ca63a7e44 [tint] Preserve derivatives in DemoteToHelper by James Price <>
  - 29b75b83730ce94abbb603f7dd4c0afbadf21192 Revert "Use abseil's build targets instead of custom ones." by Geoff Lang <>
  - 8a8c582e290b89d92e129ec31b9b69794a91285d [tintd] Add package-lock.json by Ben Clayton <>
  - e770313425483dc500296624f6889e9a20ee8cbf tint_cmd: Flush stderr after emitting non-error diagnostics by Antonio Maiorano <>
  - 11dc848eca01299dbc124f3e41ee8166e7e2c340 [tint][wgsl] Expand module-scope declaration sources to c... by Ben Clayton <>
  - 89c05af961c8118aa2b8bacf950f9ced8223b2f7 [tint][core] Move core::intrinsic::Match() from .cc to Co... by Ben Clayton <>
  - 0e3657146c65ae3275703e92a087350cc81da33c [tint][wgsl] Stub 'ls' the language server package for WG... by Ben Clayton <>
  - 0a7731b7d7855b01b929f7fe364f9c208b225ab5 tint/win: fix TmpFilePath asserting in some msvc crts by Antonio Maiorano <>
  - 65afc844c0176313c8f97c87d3c20b6671aa73ba [tint][utils] Fixes for TerminalIsDark() by Ben Clayton <>
  - f9a5b712d89d18e969d08e1f7b90fd0c6197b56b [tint] Add DEPS & build support for jsoncpp, langsvr by Ben Clayton <>
  - ad08453d7254b0859b5524b0b5475730755ceb2a [tint][ast] Fix std140 matrix size by Ben Clayton <>
  - 2ce42fc95ab7cf7bbf97a9c48876c67c95f9cb78 Use abseil's build targets instead of custom ones. by Geoff Lang <>
GitOrigin-RevId: 27f0080bbe19e7be70257d6cd4dcc3867e5781b6
Change-Id: I84800f0b65ba70f93422cce1bfea062070278f56
Commit-Queue: Antonio Maiorano <>
Reviewed-by: Antonio Maiorano <>
Kokoro: Kokoro <>
Auto-Submit: Ben Clayton <>
95 files changed
tree: d7ec9502b2952a991d27c99478865610275a22bd
  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
  22. OWNERS
  25. standalone.gclient


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.