Commit Graph

13 Commits

Author SHA1 Message Date
Vasyl Teliman 0b3611b8c8 Add spirv-tools fuzzer
This change adds a new tint fuzzer that uses SPIRV-Tools to fuzz SPIR-V binaries.
The fuzzer works on a corpus of SPIR-V shaders. For each shader from the corpus it uses
one of `spirv-fuzz`, `spirv-reduce` or `spirv-opt` to mutate and then runs the shader through
the Tint compiler in two steps:
- Converts the mutated shader to WGSL.
- Converts WGSL to some target language specified in the CLI arguments.

The list of all supported CLI arguments and their description is in the cli.h file.

Change-Id: I95c0741b78ccc600dd9a73c371d520bdf7814352
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/41945
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Vasyl Teliman <vasniktel@gmail.com>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Alastair Donaldson <allydonaldson@googlemail.com>
2021-06-24 18:10:46 +00:00
Antonio Maiorano 5f5f79c71f gitignore /build*/ folders
Useful when making multiple out of source builds from the same source.
Also made it ignore only build folders from the root, in case there's
any "build*" subfolder in the tree.

Change-Id: I0140bb3aed73d2e88a6f1165f2b4c80fb99a8cf8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/51141
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2021-05-18 14:42:47 +00:00
Ben Clayton 54f4a21ee0 tools: Shuffle go code into an idiomatic tree
main packages usually go under a `cmd` directory.
Hoist utility packages to the root `src` directroy so they can be shared.

Change-Id: I0c221f6cd39980f5c202c030cd5134d775533efa
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/50901
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
2021-05-14 18:47:33 +00:00
Ben Clayton 63c87d9582 Add .vscode/tasks.json
Contains a bunch of helper tasks for building the project and pushing changes to gerrit

Change-Id: I1f2b118e0fd811c5b67f26803d94569609697284
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/44785
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2021-03-16 13:33:23 +00:00
Ben Clayton 4bd4b8fecb .gitignore: Add default.profraw
Emitted in the CWD when you run executables with the coverage enabled.
I find myself running the unittests from the project root a lot, and this file is annoying to skip when staging code.

Change-Id: I25557c941b2723aa300fcde827d281b054cbf2fd
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/42843
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-02-26 18:39:08 +00:00
Vasyl Teliman 579f6a0450 Fix typos in CMakeLists
Change-Id: Ieeafecd850b9b18e18596fbe6d41df9ff2944b80
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/38102
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2021-01-18 21:39:14 +00:00
Ben Clayton adb10d60de Add option and target for generating code cov info
The new `tint-generate-coverage` CMake target can be used with the clang toolchain to generate a `lcov.info` file at the root of the project, along with a `coverage.summary` human readable plain text file.

The `lcov.info` file can then be used by various tools to display code coverage information in your IDE / code editor.

Useful for ensuring decent test coverage.

Change-Id: I3d846f6da3af25d3d600d8e028f27b89e35b545f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31121
Commit-Queue: Ben Clayton <bclayton@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-10-27 21:04:59 +00:00
dan sinclair 429aa812a0 Add simple test runner.
This CL adds a script to run tint over the shaders in a given folder and
attempt to generate the WGSL, HLSL, MSL and SPIRV-ASM shaders. The
GPUWeb CTS is added to third_party and the validation folder set as the
default folder to execute.

Change-Id: I63a0af056416e2f99ed8e3f92f9e2ca31c2b3e49
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25561
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com>
2020-07-23 15:01:37 +00:00
dan sinclair 6ca2699eaf Windows fixes.
This CL fixes up some issues which give compile errors when building
with Visual Studio.

Change-Id: Ib76644d869dd2adccd579621d18804d84b65a74c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20940
Reviewed-by: David Neto <dneto@google.com>
2020-05-04 18:58:24 +00:00
dan sinclair 228392558f [spirv-writer] Add start of break and continue.
This CL adds the beginning of break and continue support. The
conditional versions are not supported, just the non-conditional.

Bug: tint:5
Change-Id: I84418cffd3e29dc011c4313bf9aa3da4833c009f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20500
Reviewed-by: David Neto <dneto@google.com>
2020-04-27 20:32:56 +00:00
dan sinclair 0e2da73625 More ignores
Change-Id: Ia855252b711cc20d96780b1880eb28ee29d90364
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19360
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-04-12 18:21:02 +00:00
Dan Sinclair bf2b8973ed Add gclient files to gitignore
This Cl updates the .gitignore with the .gclient and .gclient_entries
files.

Bug: tint:12
Change-Id: I645016ca83396c0616f2ad3f69d2ce510be59b53
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16580
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-03-05 18:17:32 +00:00
Dan Sinclair 6e581895a5 Initial commit 2020-03-02 15:47:43 -05:00