commit | 5c0457c78570fe914c02b8940d43a230572bc5ac | [log] [tgz] |
---|---|---|
author | Tint team <no-reply@google.com> | Mon Aug 22 14:19:49 2022 +0000 |
committer | Tint LUCI CQ <tint-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Aug 22 14:19:49 2022 +0000 |
tree | 75df9241ef0bb0895f7c5141ed9aea1843e522f1 | |
parent | 984c6cae83b40aee2f3a8ccc49a7f204499ef832 [diff] |
Import Tint changes from Dawn Changes: - 158c85dab456c06b5d99d4c509841ad697b399fd Add new relational rules to WGSL grammar. by dan sinclair <dsinclair@chromium.org> - 97e0c71eb6a3804e94936835faa5cf5ae91706dc Add new shift expression grammar rule. by dan sinclair <dsinclair@chromium.org> - 9d27ab70439e3c0fb971fc89865e984a2369a28c Update parser comments. by dan sinclair <dsinclair@chromium.org> - d0ccb1aae63ae89338a94e317436863c825cd130 tint/fuzzers: Add a fuzzer that tests concurrency by Ben Clayton <bclayton@google.com> - 2788becd0995b6a2cdea9c81f5f8e7192d40b4b7 Add `element_count_expression` to WGSL parser by dan sinclair <dsinclair@chromium.org> - 5d7de871b40058018df33b8d5513f66ea4cd7c2d tint/writer/msl: Remove TODO and old logic by Ben Clayton <bclayton@google.com> - 58794ae1189c675f4c7eb5d2021edb583c3f4f53 tint::ProgramBuilder: Simplify variable constructors by Ben Clayton <bclayton@google.com> GitOrigin-RevId: 158c85dab456c06b5d99d4c509841ad697b399fd Change-Id: I569ff387e005229c7ed542787f89753c93418abc Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/99860 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Ben Clayton <bclayton@google.com>
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.
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.
# Clone the repo as "tint" git clone https://dawn.googlesource.com/tint tint cd tint # Bootstrap the gclient configuration cp standalone.gclient .gclient # Fetch external dependencies and toolchains with gclient gclient sync
mkdir -p out/Debug cd out/Debug cmake -GNinja ../.. ninja # or autoninja
mkdir -p out/Debug cd out/Debug cmake ../.. make # -j N for N-way parallel build
mkdir -p out/Debug gn gen out/Debug autoninja -C out/Debug
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/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/lib/darwin/libclang_rt.fuzzer_osx.a
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.
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 https://bugs.chromium.org/p/tint/issues/entry
Please see the contributing guide in the Dawn repo.