Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 1 | # Tint |
| 2 | |
| 3 | Tint is a compiler for the WebGPU Shader Language (WGSL). |
| 4 | |
| 5 | This is not an officially supported Google product. |
| 6 | |
| 7 | ## Requirements |
| 8 | * Git |
| 9 | * CMake (3.10.2 or later) |
| 10 | * Ninja (or other build tool) |
| 11 | * Python, for fetching dependencies |
| 12 | |
| 13 | ## Build options |
| 14 | * `TINT_BUILD_SPV_PARSER` : enable the SPIR-V input parser |
| 15 | |
| 16 | ## Building |
Ryan Harrison | db6ade7 | 2020-03-05 15:58:27 +0000 | [diff] [blame] | 17 | Tint uses Chromium dependency management so you need to [install depot_tools] and add it to your PATH. |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 18 | |
Ryan Harrison | db6ade7 | 2020-03-05 15:58:27 +0000 | [diff] [blame] | 19 | [install depot_tools]: http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up |
| 20 | |
| 21 | ### Getting source & dependencies |
| 22 | |
| 23 | ```sh |
| 24 | # Clone the repo as "tint" |
| 25 | git clone https://dawn.googlesource.com/tint tint && cd tint |
| 26 | |
| 27 | # Bootstrap the gclient configuration |
| 28 | cp standalone.gclient .gclient |
| 29 | |
| 30 | # Fetch external dependencies and toolchains with gclient |
| 31 | gclient sync |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 32 | ``` |
Ryan Harrison | db6ade7 | 2020-03-05 15:58:27 +0000 | [diff] [blame] | 33 | |
| 34 | ### Compiling using CMake + Ninja |
| 35 | ```sh |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 36 | mkdir -p out/Debug |
| 37 | cd out/Debug |
| 38 | cmake -GNinja ../.. |
Ryan Harrison | db6ade7 | 2020-03-05 15:58:27 +0000 | [diff] [blame] | 39 | ninja # or autoninja |
| 40 | ``` |
| 41 | |
| 42 | ### Compiling using CMake + make |
| 43 | ```sh |
| 44 | mkdir -p out/Debug |
| 45 | cd out/Debug |
| 46 | cmake ../.. |
| 47 | make # -j N for N-way parallel build |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 48 | ``` |
| 49 | |
Dan Sinclair | 707705d | 2020-03-05 15:06:38 +0000 | [diff] [blame] | 50 | ## Issues |
| 51 | Please file any issues or feature requests at |
| 52 | https://bugs.chromium.org/p/tint/issues/entry |
| 53 | |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 54 | ## Contributing |
| 55 | Please see the CONTRIBUTING and CODE_OF_CONDUCT files on how to contribute to |
| 56 | Tint. |