CMake-only fork of https://dawn.googlesource.com/dawn with cleaned, vendored dependencies
Go to file
David Neto aa5686acc3 Roll spirv-tools and spirv-headers
Roll third_party/spirv-tools/ ecdd9a3e6..640b17b5f (31 commits)

ecdd9a3e6b..640b17b5fb

$ git log ecdd9a3e6..640b17b5f --date=short --no-merges --format='%ad %ae %s'
2021-07-14 pkasting Fix -Wunreachable-code-aggressive. (#4358)
2021-07-14 jaebaek spirv-opt: support SPV_EXT_shader_image_int64 (#4379)
2021-07-14 afdx Fix BUILD.gn (#4378)
2021-07-13 afdx spirv-fuzz: support building using gn (#4365)
2021-07-13 greg Fix vendor table build in BUILD.gn for nonsemantic.vulkan.debuginfo.100 (#4375)
2021-07-12 greg Add non-semantic vulkan extended instruction set (#4362)
2021-07-07 ynovikov Update SPIRV-Headers deps (#4369)
2021-07-06 alastair.donaldson spirv-reduce: Eliminate skeletal structured control flow construct (#4360)
2021-07-05 alastair.donaldson spirv-fuzz: Check updated analyses in transformation tests (#4266)
2021-07-04 alastair.donaldson spirv-fuzz: Added tests for signedness analysis (#4361)
2021-07-02 stevenperron Add remove_unused_interface_variable_pass.* to BUILD.gn (#4363)
2021-07-02 ben.ashbaugh add tests for SPV_KHR_bit_instructions (#4350)
2021-07-01 alastair.donaldson spirv-fuzz: Avoid out of bounds access (#4355)
2021-06-29 61806567+TheMostDiligent Enabled tvOS platform (#4329)
2021-06-29 3.1416f spirv-opt: A pass to removed unused input on OpEntryPoint instructions. (#4275)
2021-06-29 stevenperron Bump glob-parent from 5.0.0 to 5.1.2. (#4353)
2021-06-29 johnzupin fix strncpy bound error (#4331)
2021-06-28 alastair.donaldson spirv-reduce: Allow merging unreachable blocks (#4303)
2021-06-28 alastair.donaldson Add IsReachable function to IRContext (#4323)
2021-06-28 alastair.donaldson spirv-reduce: Cleanup a few things (#4352)
2021-06-24 alastair.donaldson spirv-fuzz: Add illustrative tests for new issues (#4347)
2021-06-24 jason.ekstrand Add validation for SPV_EXT_shader_atomic_float16_add (#4325)
2021-06-23 kpet Initial support for SPV_KHR_integer_dot_product (#4327)
2021-06-23 dneto fix symbol exports check, for Android build cases (#4342)
2021-06-22 dnovillo Start SPIRV-Tools v2021.3
2021-06-22 dnovillo Finalize SPIRV-Tools v2021.2
2021-06-21 46493288+sfricke-samsung spirv-val: Label VUID 04780 (#4334)
2021-06-21 46493288+sfricke-samsung spirv-val: Add GLCompute to VUID 04644 message (#4333)
2021-06-18 dnovillo Update CHANGES file for upcoming release.
2021-06-17 alanbaker Update SPIRV-Headers deps (#4328)
2021-06-15 alanbaker Support SPV_KHR_subgroup_uniform_control_flow (#4318)

Created with:
  roll-dep third_party/spirv-tools

Change-Id: I5e6534f9118ff2f633552c1149c03f2e06cb721c

Roll third_party/spirv-headers/ f5417a4b6..1d4e3a7e3 (9 commits)

f5417a4b66..1d4e3a7e3a

$ git log f5417a4b6..1d4e3a7e3 --date=short --no-merges --format='%ad %ae %s'
2021-07-09 mariusz.merecki Add missing capabilities and '"version" : "None"' to QuantizationModes and OverflowModes enumerants
2021-07-07 kevin.petit Fix grammar for PackedVectorFormat
2021-06-25 mariya.podchishchaeva Upstream SPV_INTEL_debug_module
2021-06-24 13504385+WyvernWang reserve value range
2021-06-23 ben.ashbaugh add support for SPV_KHR_bit_instructions
2021-06-23 kevin.petit Add CI using Github actions and update README
2020-05-22 dneto Support SPV_KHR_integer_dot_product
2021-01-12 jason.ekstrand Add header changes for SPV_EXT_shader_atomic_float16_add
2021-06-16 john Fix two ordering problems.

Created with:
  roll-dep third_party/spirv-headers

Change-Id: Icfe131fd8bdf3b9fd8fa400ba804d2ea57d27562
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58301
Auto-Submit: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2021-07-15 20:03:06 +00:00
.vscode .vscode/tasks.json: Make build & configure work for windows. 2021-03-30 20:10:08 +00:00
build_overrides Remove obsolete GN config 2021-01-18 15:25:23 +00:00
docs sem: Add CompoundStatement 2021-07-14 09:44:41 +00:00
fuzzers Add explanatory comment to fuzzer build files 2021-07-14 13:04:31 +00:00
include/tint Make ArrayLengthFromUniform transform emit a valid UBO 2021-07-14 17:28:01 +00:00
infra/config [realms] Use LUCI realms on 100% of builds. 2021-07-14 14:52:02 +00:00
kokoro test-runner: Don't print PASS rows by default 2021-06-29 13:10:25 +00:00
samples writer: Move sanitizers into the backends 2021-07-08 16:00:23 +00:00
src CloneContext: Add an overload of Replace() that takes a function 2021-07-15 19:10:15 +00:00
test Reland "Validate storage class constraints" 2021-07-15 19:09:25 +00:00
third_party Implement AST fuzzer 2021-07-13 12:01:25 +00:00
tools tools: Add gerrit-stats 2021-07-15 16:29:16 +00:00
.clang-format Initial commit 2020-03-02 15:47:43 -05:00
.gitignore Add spirv-tools fuzzer 2021-06-24 18:10:46 +00:00
.gn Get `gn gen --check` actually working in repo 2021-04-21 19:05:14 +00:00
AUTHORS Add spirv-tools fuzzer 2021-06-24 18:10:46 +00:00
BUILD.gn BUILD.gn: Remove the temporary group with Dawn migrated. 2021-03-17 07:41:03 +00:00
CMakeLists.txt Implement AST fuzzer 2021-07-13 12:01:25 +00:00
CMakeSettings.json Add CMakeSettings.json with convenient defaults 2021-03-16 18:52:53 +00:00
CODE_OF_CONDUCT.md Initial commit 2020-03-02 15:47:43 -05:00
CONTRIBUTING.md Add a style guide 2021-04-08 15:10:47 +00:00
CPPLINT.cfg Adding PRESUBMIT.py with a bunch of checks turned on 2020-06-03 13:41:41 +00:00
DEPS Roll spirv-tools and spirv-headers 2021-07-15 20:03:06 +00:00
Doxyfile Implement AST fuzzer 2021-07-13 12:01:25 +00:00
LICENSE Initial commit 2020-03-02 15:47:43 -05:00
OWNERS Add an OWNERS file 2021-03-08 16:07:55 +00:00
PRESUBMIT.py Add language check 2020-11-16 15:01:27 +00:00
README.md Proposed process for experimental extensions 2021-04-27 17:55:07 +00:00
standalone.gclient Convert dependency management to using gclient 2020-03-05 15:58:27 +00:00
tint_overrides_with_defaults.gni Change the default for BUILD.gn to build all the modules 2020-07-30 18:44:04 +00:00

README.md

Tint

Tint is a compiler for the WebGPU Shader Language (WGSL).

This is not an officially supported Google product.

Requirements

  • 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)

Building

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 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

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/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.

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

Issues

Please file any issues or feature requests at https://bugs.chromium.org/p/tint/issues/entry

Contributing

Please see the CONTRIBUTING and CODE_OF_CONDUCT files on how to contribute to Tint.

Tint has a process for supporting experimental extensions.