xref: /aosp_15_r20/external/swiftshader/third_party/SPIRV-Tools/README.md (revision 03ce13f70fcc45d86ee91b7ee4cab1936a95046e)
1*03ce13f7SAndroid Build Coastguard Worker# SPIR-V Tools
2*03ce13f7SAndroid Build Coastguard Worker[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/KhronosGroup/SPIRV-Tools/badge)](https://securityscorecards.dev/viewer/?uri=github.com/KhronosGroup/SPIRV-Tools)
3*03ce13f7SAndroid Build Coastguard Worker
4*03ce13f7SAndroid Build Coastguard WorkerNEWS 2023-01-11: Development occurs on the `main` branch.
5*03ce13f7SAndroid Build Coastguard Worker
6*03ce13f7SAndroid Build Coastguard Worker## Overview
7*03ce13f7SAndroid Build Coastguard Worker
8*03ce13f7SAndroid Build Coastguard WorkerThe SPIR-V Tools project provides an API and commands for processing SPIR-V
9*03ce13f7SAndroid Build Coastguard Workermodules.
10*03ce13f7SAndroid Build Coastguard Worker
11*03ce13f7SAndroid Build Coastguard WorkerThe project includes an assembler, binary module parser, disassembler,
12*03ce13f7SAndroid Build Coastguard Workervalidator, and optimizer for SPIR-V. Except for the optimizer, all are based
13*03ce13f7SAndroid Build Coastguard Workeron a common static library.  The library contains all of the implementation
14*03ce13f7SAndroid Build Coastguard Workerdetails, and is used in the standalone tools whilst also enabling integration
15*03ce13f7SAndroid Build Coastguard Workerinto other code bases directly. The optimizer implementation resides in its
16*03ce13f7SAndroid Build Coastguard Workerown library, which depends on the core library.
17*03ce13f7SAndroid Build Coastguard Worker
18*03ce13f7SAndroid Build Coastguard WorkerThe interfaces have stabilized:
19*03ce13f7SAndroid Build Coastguard WorkerWe don't anticipate making a breaking change for existing features.
20*03ce13f7SAndroid Build Coastguard Worker
21*03ce13f7SAndroid Build Coastguard WorkerSPIR-V is defined by the Khronos Group Inc.
22*03ce13f7SAndroid Build Coastguard WorkerSee the [SPIR-V Registry][spirv-registry] for the SPIR-V specification,
23*03ce13f7SAndroid Build Coastguard Workerheaders, and XML registry.
24*03ce13f7SAndroid Build Coastguard Worker
25*03ce13f7SAndroid Build Coastguard Worker## Downloads
26*03ce13f7SAndroid Build Coastguard Worker
27*03ce13f7SAndroid Build Coastguard WorkerThe official releases for SPIRV-Tools can be found on LunarG's
28*03ce13f7SAndroid Build Coastguard Worker[SDK download page](https://vulkan.lunarg.com/sdk/home).
29*03ce13f7SAndroid Build Coastguard Worker
30*03ce13f7SAndroid Build Coastguard WorkerFor convenience, here are also links to the latest builds (HEAD).
31*03ce13f7SAndroid Build Coastguard WorkerThose are untested automated builds. Those are not official releases, nor
32*03ce13f7SAndroid Build Coastguard Workerare guaranteed to work. Official releases builds are in the Vulkan SDK.
33*03ce13f7SAndroid Build Coastguard Worker
34*03ce13f7SAndroid Build Coastguard Worker<img alt="Linux" src="kokoro/img/linux.png" width="20px" height="20px" hspace="2px"/>[![Linux Build Status](https://storage.googleapis.com/spirv-tools/badges/build_status_linux_clang_release.svg)](https://storage.googleapis.com/spirv-tools/badges/build_link_linux_clang_release.html)
35*03ce13f7SAndroid Build Coastguard Worker<img alt="MacOS" src="kokoro/img/macos.png" width="20px" height="20px" hspace="2px"/>[![MacOS Build Status](https://storage.googleapis.com/spirv-tools/badges/build_status_macos_clang_release.svg)](https://storage.googleapis.com/spirv-tools/badges/build_link_macos_clang_release.html)
36*03ce13f7SAndroid Build Coastguard Worker<img alt="Windows" src="kokoro/img/windows.png" width="20px" height="20px" hspace="2px"/>[![Windows Build Status](https://storage.googleapis.com/spirv-tools/badges/build_status_windows_release.svg)](https://storage.googleapis.com/spirv-tools/badges/build_link_windows_vs2019_release.html)
37*03ce13f7SAndroid Build Coastguard Worker
38*03ce13f7SAndroid Build Coastguard Worker[More downloads](docs/downloads.md)
39*03ce13f7SAndroid Build Coastguard Worker
40*03ce13f7SAndroid Build Coastguard Worker## Versioning SPIRV-Tools
41*03ce13f7SAndroid Build Coastguard Worker
42*03ce13f7SAndroid Build Coastguard WorkerSee [`CHANGES`](CHANGES) for a high level summary of recent changes, by version.
43*03ce13f7SAndroid Build Coastguard Worker
44*03ce13f7SAndroid Build Coastguard WorkerSPIRV-Tools project version numbers are of the form `v`*year*`.`*index* and with
45*03ce13f7SAndroid Build Coastguard Workeran optional `-dev` suffix to indicate work in progress.  For example, the
46*03ce13f7SAndroid Build Coastguard Workerfollowing versions are ordered from oldest to newest:
47*03ce13f7SAndroid Build Coastguard Worker
48*03ce13f7SAndroid Build Coastguard Worker* `v2016.0`
49*03ce13f7SAndroid Build Coastguard Worker* `v2016.1-dev`
50*03ce13f7SAndroid Build Coastguard Worker* `v2016.1`
51*03ce13f7SAndroid Build Coastguard Worker* `v2016.2-dev`
52*03ce13f7SAndroid Build Coastguard Worker* `v2016.2`
53*03ce13f7SAndroid Build Coastguard Worker
54*03ce13f7SAndroid Build Coastguard WorkerUse the `--version` option on each command line tool to see the software
55*03ce13f7SAndroid Build Coastguard Workerversion.  An API call reports the software version as a C-style string.
56*03ce13f7SAndroid Build Coastguard Worker
57*03ce13f7SAndroid Build Coastguard Worker## Releases
58*03ce13f7SAndroid Build Coastguard Worker
59*03ce13f7SAndroid Build Coastguard WorkerThe official releases for SPIRV-Tools can be found on LunarG's
60*03ce13f7SAndroid Build Coastguard Worker[SDK download page](https://vulkan.lunarg.com/sdk/home).
61*03ce13f7SAndroid Build Coastguard Worker
62*03ce13f7SAndroid Build Coastguard WorkerYou can find either the prebuilt, and QA tested binaries, or download the
63*03ce13f7SAndroid Build Coastguard WorkerSDK Config, which lists the commits to use to build the release from scratch.
64*03ce13f7SAndroid Build Coastguard Worker
65*03ce13f7SAndroid Build Coastguard WorkerGitHub releases are deprecated, and we will not publish new releases until
66*03ce13f7SAndroid Build Coastguard Workerfurther notice.
67*03ce13f7SAndroid Build Coastguard Worker
68*03ce13f7SAndroid Build Coastguard Worker## Supported features
69*03ce13f7SAndroid Build Coastguard Worker
70*03ce13f7SAndroid Build Coastguard Worker### Assembler, binary parser, and disassembler
71*03ce13f7SAndroid Build Coastguard Worker
72*03ce13f7SAndroid Build Coastguard Worker* Support for SPIR-V 1.0, through 1.5
73*03ce13f7SAndroid Build Coastguard Worker  * Based on SPIR-V syntax described by JSON grammar files in the
74*03ce13f7SAndroid Build Coastguard Worker    [SPIRV-Headers](https://github.com/KhronosGroup/SPIRV-Headers) repository.
75*03ce13f7SAndroid Build Coastguard Worker  * Usually, support for a new version of SPIR-V is ready within days after
76*03ce13f7SAndroid Build Coastguard Worker    publication.
77*03ce13f7SAndroid Build Coastguard Worker* Support for extended instruction sets:
78*03ce13f7SAndroid Build Coastguard Worker  * GLSL std450 version 1.0 Rev 3
79*03ce13f7SAndroid Build Coastguard Worker  * OpenCL version 1.0 Rev 2
80*03ce13f7SAndroid Build Coastguard Worker* Assembler only does basic syntax checking.  No cross validation of
81*03ce13f7SAndroid Build Coastguard Worker  IDs or types is performed, except to check literal arguments to
82*03ce13f7SAndroid Build Coastguard Worker  `OpConstant`, `OpSpecConstant`, and `OpSwitch`.
83*03ce13f7SAndroid Build Coastguard Worker
84*03ce13f7SAndroid Build Coastguard WorkerSee [`docs/syntax.md`](docs/syntax.md) for the assembly language syntax.
85*03ce13f7SAndroid Build Coastguard Worker
86*03ce13f7SAndroid Build Coastguard Worker### Validator
87*03ce13f7SAndroid Build Coastguard Worker
88*03ce13f7SAndroid Build Coastguard WorkerThe validator checks validation rules described by the SPIR-V specification.
89*03ce13f7SAndroid Build Coastguard Worker
90*03ce13f7SAndroid Build Coastguard WorkerKhronos recommends that tools that create or transform SPIR-V modules use the
91*03ce13f7SAndroid Build Coastguard Workervalidator to ensure their outputs are valid, and that tools that consume SPIR-V
92*03ce13f7SAndroid Build Coastguard Workermodules optionally use the validator to protect themselves from bad inputs.
93*03ce13f7SAndroid Build Coastguard WorkerThis is especially encouraged for debug and development scenarios.
94*03ce13f7SAndroid Build Coastguard Worker
95*03ce13f7SAndroid Build Coastguard WorkerThe validator has one-sided error: it will only return an error when it has
96*03ce13f7SAndroid Build Coastguard Workerimplemented a rule check and the module violates that rule.
97*03ce13f7SAndroid Build Coastguard Worker
98*03ce13f7SAndroid Build Coastguard WorkerThe validator is incomplete.
99*03ce13f7SAndroid Build Coastguard WorkerSee the [CHANGES](CHANGES) file for reports on completed work, and
100*03ce13f7SAndroid Build Coastguard Workerthe [Validator
101*03ce13f7SAndroid Build Coastguard Workersub-project](https://github.com/KhronosGroup/SPIRV-Tools/projects/1) for planned
102*03ce13f7SAndroid Build Coastguard Workerand in-progress work.
103*03ce13f7SAndroid Build Coastguard Worker
104*03ce13f7SAndroid Build Coastguard Worker*Note*: The validator checks some Universal Limits, from section 2.17 of the SPIR-V spec.
105*03ce13f7SAndroid Build Coastguard WorkerThe validator will fail on a module that exceeds those minimum upper bound limits.
106*03ce13f7SAndroid Build Coastguard WorkerThe validator has been parameterized to allow larger values, for use when targeting
107*03ce13f7SAndroid Build Coastguard Workera more-than-minimally-capable SPIR-V consumer.
108*03ce13f7SAndroid Build Coastguard Worker
109*03ce13f7SAndroid Build Coastguard WorkerSee [`tools/val/val.cpp`](tools/val/val.cpp) or run `spirv-val --help` for the command-line help.
110*03ce13f7SAndroid Build Coastguard Worker
111*03ce13f7SAndroid Build Coastguard Worker### Optimizer
112*03ce13f7SAndroid Build Coastguard Worker
113*03ce13f7SAndroid Build Coastguard WorkerThe optimizer is a collection of code transforms, or "passes".
114*03ce13f7SAndroid Build Coastguard WorkerTransforms are written for a diverse set of reasons:
115*03ce13f7SAndroid Build Coastguard Worker
116*03ce13f7SAndroid Build Coastguard Worker* To restructure, simplify, or normalize the code for further processing.
117*03ce13f7SAndroid Build Coastguard Worker* To eliminate undesirable code.
118*03ce13f7SAndroid Build Coastguard Worker* To improve code quality in some metric such as size or performance.
119*03ce13f7SAndroid Build Coastguard Worker  **Note**: These transforms are not guaranteed to actually improve any
120*03ce13f7SAndroid Build Coastguard Worker  given metric. Users should always measure results for their own situation.
121*03ce13f7SAndroid Build Coastguard Worker
122*03ce13f7SAndroid Build Coastguard WorkerAs of this writing, there are 67 transforms including examples such as:
123*03ce13f7SAndroid Build Coastguard Worker* Simplification
124*03ce13f7SAndroid Build Coastguard Worker  * Strip debug info
125*03ce13f7SAndroid Build Coastguard Worker  * Strip reflection info
126*03ce13f7SAndroid Build Coastguard Worker* Specialization Constants
127*03ce13f7SAndroid Build Coastguard Worker  * Set spec constant default value
128*03ce13f7SAndroid Build Coastguard Worker  * Freeze spec constant to default value
129*03ce13f7SAndroid Build Coastguard Worker  * Fold `OpSpecConstantOp` and `OpSpecConstantComposite`
130*03ce13f7SAndroid Build Coastguard Worker  * Unify constants
131*03ce13f7SAndroid Build Coastguard Worker  * Eliminate dead constant
132*03ce13f7SAndroid Build Coastguard Worker* Code Reduction
133*03ce13f7SAndroid Build Coastguard Worker  * Inline all function calls exhaustively
134*03ce13f7SAndroid Build Coastguard Worker  * Convert local access chains to inserts/extracts
135*03ce13f7SAndroid Build Coastguard Worker  * Eliminate local load/store in single block
136*03ce13f7SAndroid Build Coastguard Worker  * Eliminate local load/store with single store
137*03ce13f7SAndroid Build Coastguard Worker  * Eliminate local load/store with multiple stores
138*03ce13f7SAndroid Build Coastguard Worker  * Eliminate local extract from insert
139*03ce13f7SAndroid Build Coastguard Worker  * Eliminate dead instructions (aggressive)
140*03ce13f7SAndroid Build Coastguard Worker  * Eliminate dead branches
141*03ce13f7SAndroid Build Coastguard Worker  * Merge single successor / single predecessor block pairs
142*03ce13f7SAndroid Build Coastguard Worker  * Eliminate common uniform loads
143*03ce13f7SAndroid Build Coastguard Worker  * Remove duplicates: Capabilities, extended instruction imports, types, and
144*03ce13f7SAndroid Build Coastguard Worker    decorations.
145*03ce13f7SAndroid Build Coastguard Worker* Normalization
146*03ce13f7SAndroid Build Coastguard Worker  * Compact IDs
147*03ce13f7SAndroid Build Coastguard Worker  * CFG cleanup
148*03ce13f7SAndroid Build Coastguard Worker  * Flatten decorations
149*03ce13f7SAndroid Build Coastguard Worker  * Merge returns
150*03ce13f7SAndroid Build Coastguard Worker  * Convert AMD-specific instructions to KHR instructions
151*03ce13f7SAndroid Build Coastguard Worker* Code improvement
152*03ce13f7SAndroid Build Coastguard Worker  * Conditional constant propagation
153*03ce13f7SAndroid Build Coastguard Worker  * If-conversion
154*03ce13f7SAndroid Build Coastguard Worker  * Loop fission
155*03ce13f7SAndroid Build Coastguard Worker  * Loop fusion
156*03ce13f7SAndroid Build Coastguard Worker  * Loop-invariant code motion
157*03ce13f7SAndroid Build Coastguard Worker  * Loop unroll
158*03ce13f7SAndroid Build Coastguard Worker* Other
159*03ce13f7SAndroid Build Coastguard Worker  * Graphics robust access
160*03ce13f7SAndroid Build Coastguard Worker  * Upgrade memory model to VulkanKHR
161*03ce13f7SAndroid Build Coastguard Worker
162*03ce13f7SAndroid Build Coastguard WorkerAdditionally, certain sets of transformations have been packaged into
163*03ce13f7SAndroid Build Coastguard Workerhigher-level recipes.  These include:
164*03ce13f7SAndroid Build Coastguard Worker
165*03ce13f7SAndroid Build Coastguard Worker* Optimization for size (`spirv-opt -Os`)
166*03ce13f7SAndroid Build Coastguard Worker* Optimization for performance (`spirv-opt -O`)
167*03ce13f7SAndroid Build Coastguard Worker
168*03ce13f7SAndroid Build Coastguard WorkerFor the latest list with detailed documentation, please refer to
169*03ce13f7SAndroid Build Coastguard Worker[`include/spirv-tools/optimizer.hpp`](include/spirv-tools/optimizer.hpp).
170*03ce13f7SAndroid Build Coastguard Worker
171*03ce13f7SAndroid Build Coastguard WorkerFor suggestions on using the code reduction options, please refer to this [white paper](https://www.lunarg.com/shader-compiler-technologies/white-paper-spirv-opt/).
172*03ce13f7SAndroid Build Coastguard Worker
173*03ce13f7SAndroid Build Coastguard Worker
174*03ce13f7SAndroid Build Coastguard Worker### Linker
175*03ce13f7SAndroid Build Coastguard Worker
176*03ce13f7SAndroid Build Coastguard Worker*Note:* The linker is still under development.
177*03ce13f7SAndroid Build Coastguard Worker
178*03ce13f7SAndroid Build Coastguard WorkerCurrent features:
179*03ce13f7SAndroid Build Coastguard Worker* Combine multiple SPIR-V binary modules together.
180*03ce13f7SAndroid Build Coastguard Worker* Combine into a library (exports are retained) or an executable (no symbols
181*03ce13f7SAndroid Build Coastguard Worker  are exported).
182*03ce13f7SAndroid Build Coastguard Worker
183*03ce13f7SAndroid Build Coastguard WorkerSee the [CHANGES](CHANGES) file for reports on completed work, and the [General
184*03ce13f7SAndroid Build Coastguard Workersub-project](https://github.com/KhronosGroup/SPIRV-Tools/projects/2) for
185*03ce13f7SAndroid Build Coastguard Workerplanned and in-progress work.
186*03ce13f7SAndroid Build Coastguard Worker
187*03ce13f7SAndroid Build Coastguard Worker
188*03ce13f7SAndroid Build Coastguard Worker### Reducer
189*03ce13f7SAndroid Build Coastguard Worker
190*03ce13f7SAndroid Build Coastguard Worker*Note:* The reducer is still under development.
191*03ce13f7SAndroid Build Coastguard Worker
192*03ce13f7SAndroid Build Coastguard WorkerThe reducer simplifies and shrinks a SPIR-V module with respect to a
193*03ce13f7SAndroid Build Coastguard Workeruser-supplied *interestingness function*.  For example, given a large
194*03ce13f7SAndroid Build Coastguard WorkerSPIR-V module that cause some SPIR-V compiler to fail with a given
195*03ce13f7SAndroid Build Coastguard Workerfatal error message, the reducer could be used to look for a smaller
196*03ce13f7SAndroid Build Coastguard Workerversion of the module that causes the compiler to fail with the same
197*03ce13f7SAndroid Build Coastguard Workerfatal error message.
198*03ce13f7SAndroid Build Coastguard Worker
199*03ce13f7SAndroid Build Coastguard WorkerTo suggest an additional capability for the reducer, [file an
200*03ce13f7SAndroid Build Coastguard Workerissue](https://github.com/KhronosGroup/SPIRV-Tools/issues]) with
201*03ce13f7SAndroid Build Coastguard Worker"Reducer:" as the start of its title.
202*03ce13f7SAndroid Build Coastguard Worker
203*03ce13f7SAndroid Build Coastguard Worker
204*03ce13f7SAndroid Build Coastguard Worker### Fuzzer
205*03ce13f7SAndroid Build Coastguard Worker
206*03ce13f7SAndroid Build Coastguard Worker*Note:* The fuzzer is still under development.
207*03ce13f7SAndroid Build Coastguard Worker
208*03ce13f7SAndroid Build Coastguard WorkerThe fuzzer applies semantics-preserving transformations to a SPIR-V binary
209*03ce13f7SAndroid Build Coastguard Workermodule, to produce an equivalent module.  The original and transformed modules
210*03ce13f7SAndroid Build Coastguard Workershould produce essentially identical results when executed on identical inputs:
211*03ce13f7SAndroid Build Coastguard Workertheir results should differ only due to floating-point round-off, if at all.
212*03ce13f7SAndroid Build Coastguard WorkerSignificant differences in results can pinpoint bugs in tools that process
213*03ce13f7SAndroid Build Coastguard WorkerSPIR-V binaries, such as miscompilations.  This *metamorphic testing* approach
214*03ce13f7SAndroid Build Coastguard Workeris similar to the method used by the [GraphicsFuzz
215*03ce13f7SAndroid Build Coastguard Workerproject](https://github.com/google/graphicsfuzz) for fuzzing of GLSL shaders.
216*03ce13f7SAndroid Build Coastguard Worker
217*03ce13f7SAndroid Build Coastguard WorkerTo suggest an additional capability for the fuzzer, [file an
218*03ce13f7SAndroid Build Coastguard Workerissue](https://github.com/KhronosGroup/SPIRV-Tools/issues]) with
219*03ce13f7SAndroid Build Coastguard Worker"Fuzzer:" as the start of its title.
220*03ce13f7SAndroid Build Coastguard Worker
221*03ce13f7SAndroid Build Coastguard Worker
222*03ce13f7SAndroid Build Coastguard Worker### Diff
223*03ce13f7SAndroid Build Coastguard Worker
224*03ce13f7SAndroid Build Coastguard Worker*Note:* The diff tool is still under development.
225*03ce13f7SAndroid Build Coastguard Worker
226*03ce13f7SAndroid Build Coastguard WorkerThe diff tool takes two SPIR-V files, either in binary or text format and
227*03ce13f7SAndroid Build Coastguard Workerproduces a diff-style comparison between the two.  The instructions between the
228*03ce13f7SAndroid Build Coastguard Workersrc and dst modules are matched as best as the tool can, and output is produced
229*03ce13f7SAndroid Build Coastguard Worker(in src id-space) that shows which instructions are removed in src, added in dst
230*03ce13f7SAndroid Build Coastguard Workeror modified between them.  The order of instructions are not retained.
231*03ce13f7SAndroid Build Coastguard Worker
232*03ce13f7SAndroid Build Coastguard WorkerMatching instructions between two SPIR-V modules is not trivial, and thus a
233*03ce13f7SAndroid Build Coastguard Workernumber of heuristics are applied in this tool.  In particular, without debug
234*03ce13f7SAndroid Build Coastguard Workerinformation, match functions is nontrivial as they can be reordered.  As such,
235*03ce13f7SAndroid Build Coastguard Workerthis tool is primarily useful to produce the diff of two SPIR-V modules derived
236*03ce13f7SAndroid Build Coastguard Workerfrom the same source, for example before and after a modification to the shader,
237*03ce13f7SAndroid Build Coastguard Workerbefore and after a transformation, or SPIR-V produced from different tools.
238*03ce13f7SAndroid Build Coastguard Worker
239*03ce13f7SAndroid Build Coastguard Worker
240*03ce13f7SAndroid Build Coastguard Worker### Extras
241*03ce13f7SAndroid Build Coastguard Worker
242*03ce13f7SAndroid Build Coastguard Worker* [Utility filters](#utility-filters)
243*03ce13f7SAndroid Build Coastguard Worker* Build target `spirv-tools-vimsyntax` generates file `spvasm.vim`.
244*03ce13f7SAndroid Build Coastguard Worker  Copy that file into your `$HOME/.vim/syntax` directory to get SPIR-V assembly syntax
245*03ce13f7SAndroid Build Coastguard Worker  highlighting in Vim.  This build target is not built by default.
246*03ce13f7SAndroid Build Coastguard Worker
247*03ce13f7SAndroid Build Coastguard Worker## Contributing
248*03ce13f7SAndroid Build Coastguard Worker
249*03ce13f7SAndroid Build Coastguard WorkerThe SPIR-V Tools project is maintained by members of the The Khronos Group Inc.,
250*03ce13f7SAndroid Build Coastguard Workerand is hosted at https://github.com/KhronosGroup/SPIRV-Tools.
251*03ce13f7SAndroid Build Coastguard Worker
252*03ce13f7SAndroid Build Coastguard WorkerConsider joining the `[email protected]` mailing list, via
253*03ce13f7SAndroid Build Coastguard Worker[https://www.khronos.org/spir/spirv-tools-mailing-list/](https://www.khronos.org/spir/spirv-tools-mailing-list/).
254*03ce13f7SAndroid Build Coastguard WorkerThe mailing list is used to discuss development plans for the SPIRV-Tools as an open source project.
255*03ce13f7SAndroid Build Coastguard WorkerOnce discussion is resolved,
256*03ce13f7SAndroid Build Coastguard Workerspecific work is tracked via issues and sometimes in one of the
257*03ce13f7SAndroid Build Coastguard Worker[projects][spirv-tools-projects].
258*03ce13f7SAndroid Build Coastguard Worker
259*03ce13f7SAndroid Build Coastguard Worker(To provide feedback on the SPIR-V _specification_, file an issue on the
260*03ce13f7SAndroid Build Coastguard Worker[SPIRV-Headers][spirv-headers] GitHub repository.)
261*03ce13f7SAndroid Build Coastguard Worker
262*03ce13f7SAndroid Build Coastguard WorkerSee [`docs/projects.md`](docs/projects.md) to see how we use the
263*03ce13f7SAndroid Build Coastguard Worker[GitHub Project
264*03ce13f7SAndroid Build Coastguard Workerfeature](https://help.github.com/articles/tracking-the-progress-of-your-work-with-projects/)
265*03ce13f7SAndroid Build Coastguard Workerto organize planned and in-progress work.
266*03ce13f7SAndroid Build Coastguard Worker
267*03ce13f7SAndroid Build Coastguard WorkerContributions via merge request are welcome. Changes should:
268*03ce13f7SAndroid Build Coastguard Worker* Be provided under the [Apache 2.0](#license).
269*03ce13f7SAndroid Build Coastguard Worker* You'll be prompted with a one-time "click-through"
270*03ce13f7SAndroid Build Coastguard Worker  [Khronos Open Source Contributor License Agreement][spirv-tools-cla]
271*03ce13f7SAndroid Build Coastguard Worker  (CLA) dialog as part of submitting your pull request or
272*03ce13f7SAndroid Build Coastguard Worker  other contribution to GitHub.
273*03ce13f7SAndroid Build Coastguard Worker* Include tests to cover updated functionality.
274*03ce13f7SAndroid Build Coastguard Worker* C++ code should follow the [Google C++ Style Guide][cpp-style-guide].
275*03ce13f7SAndroid Build Coastguard Worker* Code should be formatted with `clang-format`.
276*03ce13f7SAndroid Build Coastguard Worker  [kokoro/check-format/build.sh](kokoro/check-format/build.sh)
277*03ce13f7SAndroid Build Coastguard Worker  shows how to download it. Note that we currently use
278*03ce13f7SAndroid Build Coastguard Worker  `clang-format version 5.0.0` for SPIRV-Tools. Settings are defined by
279*03ce13f7SAndroid Build Coastguard Worker  the included [.clang-format](.clang-format) file.
280*03ce13f7SAndroid Build Coastguard Worker
281*03ce13f7SAndroid Build Coastguard WorkerWe intend to maintain a linear history on the GitHub `main` branch.
282*03ce13f7SAndroid Build Coastguard Worker
283*03ce13f7SAndroid Build Coastguard Worker### Getting the source
284*03ce13f7SAndroid Build Coastguard Worker
285*03ce13f7SAndroid Build Coastguard WorkerExample of getting sources, assuming SPIRV-Tools is configured as a standalone project:
286*03ce13f7SAndroid Build Coastguard Worker
287*03ce13f7SAndroid Build Coastguard Worker    git clone https://github.com/KhronosGroup/SPIRV-Tools.git   spirv-tools
288*03ce13f7SAndroid Build Coastguard Worker    cd spirv-tools
289*03ce13f7SAndroid Build Coastguard Worker
290*03ce13f7SAndroid Build Coastguard Worker    # Check out sources for dependencies, at versions known to work together,
291*03ce13f7SAndroid Build Coastguard Worker    # as listed in the DEPS file.
292*03ce13f7SAndroid Build Coastguard Worker    python3 utils/git-sync-deps
293*03ce13f7SAndroid Build Coastguard Worker
294*03ce13f7SAndroid Build Coastguard WorkerFor some kinds of development, you may need the latest sources from the third-party projects:
295*03ce13f7SAndroid Build Coastguard Worker
296*03ce13f7SAndroid Build Coastguard Worker    git clone https://github.com/KhronosGroup/SPIRV-Headers.git spirv-tools/external/spirv-headers
297*03ce13f7SAndroid Build Coastguard Worker    git clone https://github.com/google/googletest.git          spirv-tools/external/googletest
298*03ce13f7SAndroid Build Coastguard Worker    git clone https://github.com/google/effcee.git              spirv-tools/external/effcee
299*03ce13f7SAndroid Build Coastguard Worker    git clone https://github.com/google/re2.git                 spirv-tools/external/re2
300*03ce13f7SAndroid Build Coastguard Worker    git clone https://github.com/abseil/abseil-cpp.git          spirv-tools/external/abseil_cpp
301*03ce13f7SAndroid Build Coastguard Worker
302*03ce13f7SAndroid Build Coastguard Worker#### Dependency on Effcee
303*03ce13f7SAndroid Build Coastguard Worker
304*03ce13f7SAndroid Build Coastguard WorkerSome tests depend on the [Effcee][effcee] library for stateful matching.
305*03ce13f7SAndroid Build Coastguard WorkerEffcee itself depends on [RE2][re2], and RE2 depends on [Abseil][abseil-cpp].
306*03ce13f7SAndroid Build Coastguard Worker
307*03ce13f7SAndroid Build Coastguard Worker* If SPIRV-Tools is configured as part of a larger project that already uses
308*03ce13f7SAndroid Build Coastguard Worker  Effcee, then that project should include Effcee before SPIRV-Tools.
309*03ce13f7SAndroid Build Coastguard Worker* Otherwise, SPIRV-Tools expects Effcee sources to appear in `external/effcee`,
310*03ce13f7SAndroid Build Coastguard Worker  RE2 sources to appear in `external/re2`, and Abseil sources to appear in
311*03ce13f7SAndroid Build Coastguard Worker  `external/abseil_cpp`.
312*03ce13f7SAndroid Build Coastguard Worker
313*03ce13f7SAndroid Build Coastguard Worker### Source code organization
314*03ce13f7SAndroid Build Coastguard Worker
315*03ce13f7SAndroid Build Coastguard Worker* `example`: demo code of using SPIRV-Tools APIs
316*03ce13f7SAndroid Build Coastguard Worker* `external/googletest`: Intended location for the
317*03ce13f7SAndroid Build Coastguard Worker  [googletest][googletest] sources, not provided
318*03ce13f7SAndroid Build Coastguard Worker* `external/effcee`: Location of [Effcee][effcee] sources, if the `effcee` library
319*03ce13f7SAndroid Build Coastguard Worker  is not already configured by an enclosing project.
320*03ce13f7SAndroid Build Coastguard Worker* `external/re2`: Location of [RE2][re2] sources, if the `re2` library is not already
321*03ce13f7SAndroid Build Coastguard Worker  configured by an enclosing project.
322*03ce13f7SAndroid Build Coastguard Worker  (The Effcee project already requires RE2.)
323*03ce13f7SAndroid Build Coastguard Worker* `external/abseil_cpp`: Location of [Abseil][abseil-cpp] sources, if Abseil is
324*03ce13f7SAndroid Build Coastguard Worker   not already configured by an enclosing project.
325*03ce13f7SAndroid Build Coastguard Worker  (The RE2 project already requires Abseil.)
326*03ce13f7SAndroid Build Coastguard Worker* `include/`: API clients should add this directory to the include search path
327*03ce13f7SAndroid Build Coastguard Worker* `external/spirv-headers`: Intended location for
328*03ce13f7SAndroid Build Coastguard Worker  [SPIR-V headers][spirv-headers], not provided
329*03ce13f7SAndroid Build Coastguard Worker* `include/spirv-tools/libspirv.h`: C API public interface
330*03ce13f7SAndroid Build Coastguard Worker* `source/`: API implementation
331*03ce13f7SAndroid Build Coastguard Worker* `test/`: Tests, using the [googletest][googletest] framework
332*03ce13f7SAndroid Build Coastguard Worker* `tools/`: Command line executables
333*03ce13f7SAndroid Build Coastguard Worker
334*03ce13f7SAndroid Build Coastguard Worker### Tests
335*03ce13f7SAndroid Build Coastguard Worker
336*03ce13f7SAndroid Build Coastguard WorkerThe project contains a number of tests, used to drive development
337*03ce13f7SAndroid Build Coastguard Workerand ensure correctness.  The tests are written using the
338*03ce13f7SAndroid Build Coastguard Worker[googletest][googletest] framework.  The `googletest`
339*03ce13f7SAndroid Build Coastguard Workersource is not provided with this project.  There are two ways to enable
340*03ce13f7SAndroid Build Coastguard Workertests:
341*03ce13f7SAndroid Build Coastguard Worker* If SPIR-V Tools is configured as part of an enclosing project, then the
342*03ce13f7SAndroid Build Coastguard Worker  enclosing project should configure `googletest` before configuring SPIR-V Tools.
343*03ce13f7SAndroid Build Coastguard Worker* If SPIR-V Tools is configured as a standalone project, then download the
344*03ce13f7SAndroid Build Coastguard Worker  `googletest` source into the `<spirv-dir>/external/googletest` directory before
345*03ce13f7SAndroid Build Coastguard Worker  configuring and building the project.
346*03ce13f7SAndroid Build Coastguard Worker
347*03ce13f7SAndroid Build Coastguard Worker## Build
348*03ce13f7SAndroid Build Coastguard Worker
349*03ce13f7SAndroid Build Coastguard Worker*Note*: Prebuilt binaries are available from the [downloads](docs/downloads.md) page.
350*03ce13f7SAndroid Build Coastguard Worker
351*03ce13f7SAndroid Build Coastguard WorkerFirst [get the sources](#getting-the-source).
352*03ce13f7SAndroid Build Coastguard WorkerThen build using CMake, Bazel, Android ndk-build, or the Emscripten SDK.
353*03ce13f7SAndroid Build Coastguard Worker
354*03ce13f7SAndroid Build Coastguard Worker### Build using CMake
355*03ce13f7SAndroid Build Coastguard WorkerYou can build the project using [CMake][cmake]:
356*03ce13f7SAndroid Build Coastguard Worker
357*03ce13f7SAndroid Build Coastguard Worker```sh
358*03ce13f7SAndroid Build Coastguard Workercd <spirv-dir>
359*03ce13f7SAndroid Build Coastguard Workermkdir build && cd build
360*03ce13f7SAndroid Build Coastguard Workercmake [-G <platform-generator>] <spirv-dir>
361*03ce13f7SAndroid Build Coastguard Worker```
362*03ce13f7SAndroid Build Coastguard Worker
363*03ce13f7SAndroid Build Coastguard WorkerOnce the build files have been generated, build using the appropriate build
364*03ce13f7SAndroid Build Coastguard Workercommand (e.g. `ninja`, `make`, `msbuild`, etc.; this depends on the platform
365*03ce13f7SAndroid Build Coastguard Workergenerator used above), or use your IDE, or use CMake to run the appropriate build
366*03ce13f7SAndroid Build Coastguard Workercommand for you:
367*03ce13f7SAndroid Build Coastguard Worker
368*03ce13f7SAndroid Build Coastguard Worker```sh
369*03ce13f7SAndroid Build Coastguard Workercmake --build . [--config Debug]  # runs `make` or `ninja` or `msbuild` etc.
370*03ce13f7SAndroid Build Coastguard Worker```
371*03ce13f7SAndroid Build Coastguard Worker
372*03ce13f7SAndroid Build Coastguard Worker#### Note about the fuzzer
373*03ce13f7SAndroid Build Coastguard Worker
374*03ce13f7SAndroid Build Coastguard WorkerThe SPIR-V fuzzer, `spirv-fuzz`, can only be built via CMake, and is disabled by
375*03ce13f7SAndroid Build Coastguard Workerdefault. To build it, clone protobuf and use the `SPIRV_BUILD_FUZZER` CMake
376*03ce13f7SAndroid Build Coastguard Workeroption, like so:
377*03ce13f7SAndroid Build Coastguard Worker
378*03ce13f7SAndroid Build Coastguard Worker```sh
379*03ce13f7SAndroid Build Coastguard Worker# In <spirv-dir> (the SPIRV-Tools repo root):
380*03ce13f7SAndroid Build Coastguard Workergit clone --depth=1 --branch v3.13.0.1 https://github.com/protocolbuffers/protobuf external/protobuf
381*03ce13f7SAndroid Build Coastguard Worker
382*03ce13f7SAndroid Build Coastguard Worker# In your build directory:
383*03ce13f7SAndroid Build Coastguard Workercmake [-G <platform-generator>] <spirv-dir> -DSPIRV_BUILD_FUZZER=ON
384*03ce13f7SAndroid Build Coastguard Workercmake --build . --config Debug
385*03ce13f7SAndroid Build Coastguard Worker```
386*03ce13f7SAndroid Build Coastguard Worker
387*03ce13f7SAndroid Build Coastguard WorkerYou can also add `-DSPIRV_ENABLE_LONG_FUZZER_TESTS=ON` to build additional
388*03ce13f7SAndroid Build Coastguard Workerfuzzer tests.
389*03ce13f7SAndroid Build Coastguard Worker
390*03ce13f7SAndroid Build Coastguard Worker
391*03ce13f7SAndroid Build Coastguard Worker### Build using Bazel
392*03ce13f7SAndroid Build Coastguard WorkerYou can also use [Bazel](https://bazel.build/) to build the project.
393*03ce13f7SAndroid Build Coastguard Worker
394*03ce13f7SAndroid Build Coastguard Worker```sh
395*03ce13f7SAndroid Build Coastguard Workerbazel build :all
396*03ce13f7SAndroid Build Coastguard Worker```
397*03ce13f7SAndroid Build Coastguard Worker
398*03ce13f7SAndroid Build Coastguard Worker### Build a node.js package using Emscripten
399*03ce13f7SAndroid Build Coastguard Worker
400*03ce13f7SAndroid Build Coastguard WorkerThe SPIRV-Tools core library can be built to a WebAssembly [node.js](https://nodejs.org)
401*03ce13f7SAndroid Build Coastguard Workermodule. The resulting `SpirvTools` WebAssembly module only exports methods to
402*03ce13f7SAndroid Build Coastguard Workerassemble and disassemble SPIR-V modules.
403*03ce13f7SAndroid Build Coastguard Worker
404*03ce13f7SAndroid Build Coastguard WorkerFirst, make sure you have the [Emscripten SDK](https://emscripten.org).
405*03ce13f7SAndroid Build Coastguard WorkerThen:
406*03ce13f7SAndroid Build Coastguard Worker
407*03ce13f7SAndroid Build Coastguard Worker```sh
408*03ce13f7SAndroid Build Coastguard Workercd <spirv-dir>
409*03ce13f7SAndroid Build Coastguard Worker./source/wasm/build.sh
410*03ce13f7SAndroid Build Coastguard Worker```
411*03ce13f7SAndroid Build Coastguard Worker
412*03ce13f7SAndroid Build Coastguard WorkerThe resulting node package, with JavaScript and TypeScript bindings, is
413*03ce13f7SAndroid Build Coastguard Workerwritten to `<spirv-dir>/out/web`.
414*03ce13f7SAndroid Build Coastguard Worker
415*03ce13f7SAndroid Build Coastguard WorkerNote: This builds the package locally. It does *not* publish it to [npm](https://npmjs.org).
416*03ce13f7SAndroid Build Coastguard Worker
417*03ce13f7SAndroid Build Coastguard WorkerTo test the result:
418*03ce13f7SAndroid Build Coastguard Worker
419*03ce13f7SAndroid Build Coastguard Worker```sh
420*03ce13f7SAndroid Build Coastguard Workernode ./test/wasm/test.js
421*03ce13f7SAndroid Build Coastguard Worker```
422*03ce13f7SAndroid Build Coastguard Worker
423*03ce13f7SAndroid Build Coastguard Worker### Tools you'll need
424*03ce13f7SAndroid Build Coastguard Worker
425*03ce13f7SAndroid Build Coastguard WorkerFor building and testing SPIRV-Tools, the following tools should be
426*03ce13f7SAndroid Build Coastguard Workerinstalled regardless of your OS:
427*03ce13f7SAndroid Build Coastguard Worker
428*03ce13f7SAndroid Build Coastguard Worker- [CMake](http://www.cmake.org/): if using CMake for generating compilation
429*03ce13f7SAndroid Build Coastguard Workertargets, you need to install CMake Version 2.8.12 or later.
430*03ce13f7SAndroid Build Coastguard Worker- [Python 3](http://www.python.org/): for utility scripts and running the test
431*03ce13f7SAndroid Build Coastguard Workersuite.
432*03ce13f7SAndroid Build Coastguard Worker- [Bazel](https://bazel.build/) (optional): if building the source with Bazel,
433*03ce13f7SAndroid Build Coastguard Workeryou need to install Bazel Version 7.0.2 on your machine. Other versions may
434*03ce13f7SAndroid Build Coastguard Workeralso work, but are not verified.
435*03ce13f7SAndroid Build Coastguard Worker- [Emscripten SDK](https://emscripten.org) (optional): if building the
436*03ce13f7SAndroid Build Coastguard Worker  WebAssembly module.
437*03ce13f7SAndroid Build Coastguard Worker
438*03ce13f7SAndroid Build Coastguard WorkerSPIRV-Tools is regularly tested with the following compilers:
439*03ce13f7SAndroid Build Coastguard Worker
440*03ce13f7SAndroid Build Coastguard WorkerOn Linux
441*03ce13f7SAndroid Build Coastguard Worker- GCC version 9.3
442*03ce13f7SAndroid Build Coastguard Worker- Clang version 10.0
443*03ce13f7SAndroid Build Coastguard Worker
444*03ce13f7SAndroid Build Coastguard WorkerOn MacOS
445*03ce13f7SAndroid Build Coastguard Worker- AppleClang 11.0
446*03ce13f7SAndroid Build Coastguard Worker
447*03ce13f7SAndroid Build Coastguard WorkerOn Windows
448*03ce13f7SAndroid Build Coastguard Worker- Visual Studio 2017
449*03ce13f7SAndroid Build Coastguard Worker- Visual Studio 2019
450*03ce13f7SAndroid Build Coastguard Worker- Visual Studio 2022
451*03ce13f7SAndroid Build Coastguard Worker
452*03ce13f7SAndroid Build Coastguard WorkerNote: Visual Studio 2017 has incomplete c++17 support. We might stop
453*03ce13f7SAndroid Build Coastguard Workertesting it soon. Other compilers or later versions may work, but they are not
454*03ce13f7SAndroid Build Coastguard Workertested.
455*03ce13f7SAndroid Build Coastguard Worker
456*03ce13f7SAndroid Build Coastguard Worker### CMake options
457*03ce13f7SAndroid Build Coastguard Worker
458*03ce13f7SAndroid Build Coastguard WorkerThe following CMake options are supported:
459*03ce13f7SAndroid Build Coastguard Worker
460*03ce13f7SAndroid Build Coastguard Worker* `SPIRV_BUILD_FUZZER={ON|OFF}`, default `OFF` - Build the spirv-fuzz tool.
461*03ce13f7SAndroid Build Coastguard Worker* `SPIRV_COLOR_TERMINAL={ON|OFF}`, default `ON` - Enables color console output.
462*03ce13f7SAndroid Build Coastguard Worker* `SPIRV_SKIP_TESTS={ON|OFF}`, default `OFF`- Build only the library and
463*03ce13f7SAndroid Build Coastguard Worker  the command line tools.  This will prevent the tests from being built.
464*03ce13f7SAndroid Build Coastguard Worker* `SPIRV_SKIP_EXECUTABLES={ON|OFF}`, default `OFF`- Build only the library, not
465*03ce13f7SAndroid Build Coastguard Worker  the command line tools and tests.
466*03ce13f7SAndroid Build Coastguard Worker* `SPIRV_USE_SANITIZER=<sanitizer>`, default is no sanitizing - On UNIX
467*03ce13f7SAndroid Build Coastguard Worker  platforms with an appropriate version of `clang` this option enables the use
468*03ce13f7SAndroid Build Coastguard Worker  of the sanitizers documented [here][clang-sanitizers].
469*03ce13f7SAndroid Build Coastguard Worker  This should only be used with a debug build.
470*03ce13f7SAndroid Build Coastguard Worker* `SPIRV_WARN_EVERYTHING={ON|OFF}`, default `OFF` - On UNIX platforms enable
471*03ce13f7SAndroid Build Coastguard Worker  more strict warnings.  The code might not compile with this option enabled.
472*03ce13f7SAndroid Build Coastguard Worker  For Clang, enables `-Weverything`.  For GCC, enables `-Wpedantic`.
473*03ce13f7SAndroid Build Coastguard Worker  See [`CMakeLists.txt`](CMakeLists.txt) for details.
474*03ce13f7SAndroid Build Coastguard Worker* `SPIRV_WERROR={ON|OFF}`, default `ON` - Forces a compilation error on any
475*03ce13f7SAndroid Build Coastguard Worker  warnings encountered by enabling the compiler-specific compiler front-end
476*03ce13f7SAndroid Build Coastguard Worker  option.  No compiler front-end options are enabled when this option is OFF.
477*03ce13f7SAndroid Build Coastguard Worker
478*03ce13f7SAndroid Build Coastguard WorkerAdditionally, you can pass additional C preprocessor definitions to SPIRV-Tools
479*03ce13f7SAndroid Build Coastguard Workervia setting `SPIRV_TOOLS_EXTRA_DEFINITIONS`. For example, by setting it to
480*03ce13f7SAndroid Build Coastguard Worker`/D_ITERATOR_DEBUG_LEVEL=0` on Windows, you can disable checked iterators and
481*03ce13f7SAndroid Build Coastguard Workeriterator debugging.
482*03ce13f7SAndroid Build Coastguard Worker
483*03ce13f7SAndroid Build Coastguard Worker### Android ndk-build
484*03ce13f7SAndroid Build Coastguard Worker
485*03ce13f7SAndroid Build Coastguard WorkerSPIR-V Tools supports building static libraries `libSPIRV-Tools.a` and
486*03ce13f7SAndroid Build Coastguard Worker`libSPIRV-Tools-opt.a` for Android.  Using the Android NDK r25c or later:
487*03ce13f7SAndroid Build Coastguard Worker
488*03ce13f7SAndroid Build Coastguard Worker```
489*03ce13f7SAndroid Build Coastguard Workercd <spirv-dir>
490*03ce13f7SAndroid Build Coastguard Worker
491*03ce13f7SAndroid Build Coastguard Workerexport ANDROID_NDK=/path/to/your/ndk   # NDK r25c or later
492*03ce13f7SAndroid Build Coastguard Worker
493*03ce13f7SAndroid Build Coastguard Workermkdir build && cd build
494*03ce13f7SAndroid Build Coastguard Workermkdir libs
495*03ce13f7SAndroid Build Coastguard Workermkdir app
496*03ce13f7SAndroid Build Coastguard Worker
497*03ce13f7SAndroid Build Coastguard Worker$ANDROID_NDK/ndk-build -C ../android_test     \
498*03ce13f7SAndroid Build Coastguard Worker                      NDK_PROJECT_PATH=.      \
499*03ce13f7SAndroid Build Coastguard Worker                      NDK_LIBS_OUT=`pwd`/libs \
500*03ce13f7SAndroid Build Coastguard Worker                      NDK_APP_OUT=`pwd`/app
501*03ce13f7SAndroid Build Coastguard Worker```
502*03ce13f7SAndroid Build Coastguard Worker
503*03ce13f7SAndroid Build Coastguard Worker### Updating DEPS
504*03ce13f7SAndroid Build Coastguard Worker
505*03ce13f7SAndroid Build Coastguard WorkerOccasionally the entries in [DEPS](DEPS) will need to be updated. This is done on
506*03ce13f7SAndroid Build Coastguard Workerdemand when there is a request to do this, often due to downstream breakages.
507*03ce13f7SAndroid Build Coastguard WorkerTo update `DEPS`, run `utils/roll_deps.sh` and confirm that tests pass.
508*03ce13f7SAndroid Build Coastguard WorkerThe script requires Chromium's
509*03ce13f7SAndroid Build Coastguard Worker[`depot_tools`](https://chromium.googlesource.com/chromium/tools/depot_tools).
510*03ce13f7SAndroid Build Coastguard Worker
511*03ce13f7SAndroid Build Coastguard Worker## Library
512*03ce13f7SAndroid Build Coastguard Worker
513*03ce13f7SAndroid Build Coastguard Worker### Usage
514*03ce13f7SAndroid Build Coastguard Worker
515*03ce13f7SAndroid Build Coastguard WorkerThe internals of the library use C++17 features, and are exposed via both a C
516*03ce13f7SAndroid Build Coastguard Workerand C++ API.
517*03ce13f7SAndroid Build Coastguard Worker
518*03ce13f7SAndroid Build Coastguard WorkerIn order to use the library from an application, the include path should point
519*03ce13f7SAndroid Build Coastguard Workerto `<spirv-dir>/include`, which will enable the application to include the
520*03ce13f7SAndroid Build Coastguard Workerheader `<spirv-dir>/include/spirv-tools/libspirv.h{|pp}` then linking against
521*03ce13f7SAndroid Build Coastguard Workerthe static library in `<spirv-build-dir>/source/libSPIRV-Tools.a` or
522*03ce13f7SAndroid Build Coastguard Worker`<spirv-build-dir>/source/SPIRV-Tools.lib`.
523*03ce13f7SAndroid Build Coastguard WorkerFor optimization, the header file is
524*03ce13f7SAndroid Build Coastguard Worker`<spirv-dir>/include/spirv-tools/optimizer.hpp`, and the static library is
525*03ce13f7SAndroid Build Coastguard Worker`<spirv-build-dir>/source/libSPIRV-Tools-opt.a` or
526*03ce13f7SAndroid Build Coastguard Worker`<spirv-build-dir>/source/SPIRV-Tools-opt.lib`.
527*03ce13f7SAndroid Build Coastguard Worker
528*03ce13f7SAndroid Build Coastguard Worker* `SPIRV-Tools` CMake target: Creates the static library:
529*03ce13f7SAndroid Build Coastguard Worker  * `<spirv-build-dir>/source/libSPIRV-Tools.a` on Linux and OS X.
530*03ce13f7SAndroid Build Coastguard Worker  * `<spirv-build-dir>/source/libSPIRV-Tools.lib` on Windows.
531*03ce13f7SAndroid Build Coastguard Worker* `SPIRV-Tools-opt` CMake target: Creates the static library:
532*03ce13f7SAndroid Build Coastguard Worker  * `<spirv-build-dir>/source/libSPIRV-Tools-opt.a` on Linux and OS X.
533*03ce13f7SAndroid Build Coastguard Worker  * `<spirv-build-dir>/source/libSPIRV-Tools-opt.lib` on Windows.
534*03ce13f7SAndroid Build Coastguard Worker
535*03ce13f7SAndroid Build Coastguard Worker#### Entry points
536*03ce13f7SAndroid Build Coastguard Worker
537*03ce13f7SAndroid Build Coastguard WorkerThe interfaces are still under development, and are expected to change.
538*03ce13f7SAndroid Build Coastguard Worker
539*03ce13f7SAndroid Build Coastguard WorkerThere are five main entry points into the library in the C interface:
540*03ce13f7SAndroid Build Coastguard Worker
541*03ce13f7SAndroid Build Coastguard Worker* `spvTextToBinary`: An assembler, translating text to a binary SPIR-V module.
542*03ce13f7SAndroid Build Coastguard Worker* `spvBinaryToText`: A disassembler, translating a binary SPIR-V module to
543*03ce13f7SAndroid Build Coastguard Worker  text.
544*03ce13f7SAndroid Build Coastguard Worker* `spvBinaryParse`: The entry point to a binary parser API.  It issues callbacks
545*03ce13f7SAndroid Build Coastguard Worker  for the header and each parsed instruction.  The disassembler is implemented
546*03ce13f7SAndroid Build Coastguard Worker  as a client of `spvBinaryParse`.
547*03ce13f7SAndroid Build Coastguard Worker* `spvValidate` implements the validator functionality. *Incomplete*
548*03ce13f7SAndroid Build Coastguard Worker* `spvValidateBinary` implements the validator functionality. *Incomplete*
549*03ce13f7SAndroid Build Coastguard Worker
550*03ce13f7SAndroid Build Coastguard WorkerThe C++ interface is comprised of three classes, `SpirvTools`, `Optimizer` and
551*03ce13f7SAndroid Build Coastguard Worker`Linker`, all in the `spvtools` namespace.
552*03ce13f7SAndroid Build Coastguard Worker* `SpirvTools` provides `Assemble`, `Disassemble`, and `Validate` methods.
553*03ce13f7SAndroid Build Coastguard Worker* `Optimizer` provides methods for registering and running optimization passes.
554*03ce13f7SAndroid Build Coastguard Worker* `Linker` provides methods for combining together multiple binaries.
555*03ce13f7SAndroid Build Coastguard Worker
556*03ce13f7SAndroid Build Coastguard Worker## Command line tools
557*03ce13f7SAndroid Build Coastguard Worker
558*03ce13f7SAndroid Build Coastguard WorkerCommand line tools, which wrap the above library functions, are provided to
559*03ce13f7SAndroid Build Coastguard Workerassemble or disassemble shader files.  It's a convention to name SPIR-V
560*03ce13f7SAndroid Build Coastguard Workerassembly and binary files with suffix `.spvasm` and `.spv`, respectively.
561*03ce13f7SAndroid Build Coastguard Worker
562*03ce13f7SAndroid Build Coastguard Worker### Assembler tool
563*03ce13f7SAndroid Build Coastguard Worker
564*03ce13f7SAndroid Build Coastguard WorkerThe assembler reads the assembly language text, and emits the binary form.
565*03ce13f7SAndroid Build Coastguard Worker
566*03ce13f7SAndroid Build Coastguard WorkerThe standalone assembler is the executable called `spirv-as`, and is located in
567*03ce13f7SAndroid Build Coastguard Worker`<spirv-build-dir>/tools/spirv-as`.  The functionality of the assembler is implemented
568*03ce13f7SAndroid Build Coastguard Workerby the `spvTextToBinary` library function.
569*03ce13f7SAndroid Build Coastguard Worker
570*03ce13f7SAndroid Build Coastguard Worker* `spirv-as` - the standalone assembler
571*03ce13f7SAndroid Build Coastguard Worker  * `<spirv-dir>/tools/as`
572*03ce13f7SAndroid Build Coastguard Worker
573*03ce13f7SAndroid Build Coastguard WorkerUse option `-h` to print help.
574*03ce13f7SAndroid Build Coastguard Worker
575*03ce13f7SAndroid Build Coastguard Worker### Disassembler tool
576*03ce13f7SAndroid Build Coastguard Worker
577*03ce13f7SAndroid Build Coastguard WorkerThe disassembler reads the binary form, and emits assembly language text.
578*03ce13f7SAndroid Build Coastguard Worker
579*03ce13f7SAndroid Build Coastguard WorkerThe standalone disassembler is the executable called `spirv-dis`, and is located in
580*03ce13f7SAndroid Build Coastguard Worker`<spirv-build-dir>/tools/spirv-dis`. The functionality of the disassembler is implemented
581*03ce13f7SAndroid Build Coastguard Workerby the `spvBinaryToText` library function.
582*03ce13f7SAndroid Build Coastguard Worker
583*03ce13f7SAndroid Build Coastguard Worker* `spirv-dis` - the standalone disassembler
584*03ce13f7SAndroid Build Coastguard Worker  * `<spirv-dir>/tools/dis`
585*03ce13f7SAndroid Build Coastguard Worker
586*03ce13f7SAndroid Build Coastguard WorkerUse option `-h` to print help.
587*03ce13f7SAndroid Build Coastguard Worker
588*03ce13f7SAndroid Build Coastguard WorkerThe output includes syntax colouring when printing to the standard output stream,
589*03ce13f7SAndroid Build Coastguard Workeron Linux, Windows, and OS X.
590*03ce13f7SAndroid Build Coastguard Worker
591*03ce13f7SAndroid Build Coastguard Worker### Linker tool
592*03ce13f7SAndroid Build Coastguard Worker
593*03ce13f7SAndroid Build Coastguard WorkerThe linker combines multiple SPIR-V binary modules together, resulting in a single
594*03ce13f7SAndroid Build Coastguard Workerbinary module as output.
595*03ce13f7SAndroid Build Coastguard Worker
596*03ce13f7SAndroid Build Coastguard WorkerThis is a work in progress.
597*03ce13f7SAndroid Build Coastguard WorkerThe linker does not support OpenCL program linking options related to math
598*03ce13f7SAndroid Build Coastguard Workerflags. (See section 5.6.5.2 in OpenCL 1.2)
599*03ce13f7SAndroid Build Coastguard Worker
600*03ce13f7SAndroid Build Coastguard Worker* `spirv-link` - the standalone linker
601*03ce13f7SAndroid Build Coastguard Worker  * `<spirv-dir>/tools/link`
602*03ce13f7SAndroid Build Coastguard Worker
603*03ce13f7SAndroid Build Coastguard Worker### Optimizer tool
604*03ce13f7SAndroid Build Coastguard Worker
605*03ce13f7SAndroid Build Coastguard WorkerThe optimizer processes a SPIR-V binary module, applying transformations
606*03ce13f7SAndroid Build Coastguard Workerin the specified order.
607*03ce13f7SAndroid Build Coastguard Worker
608*03ce13f7SAndroid Build Coastguard WorkerThis is a work in progress, with initially only few available transformations.
609*03ce13f7SAndroid Build Coastguard Worker
610*03ce13f7SAndroid Build Coastguard Worker* `spirv-opt` - the standalone optimizer
611*03ce13f7SAndroid Build Coastguard Worker  * `<spirv-dir>/tools/opt`
612*03ce13f7SAndroid Build Coastguard Worker
613*03ce13f7SAndroid Build Coastguard Worker### Validator tool
614*03ce13f7SAndroid Build Coastguard Worker
615*03ce13f7SAndroid Build Coastguard Worker*Warning:* This functionality is under development, and is incomplete.
616*03ce13f7SAndroid Build Coastguard Worker
617*03ce13f7SAndroid Build Coastguard WorkerThe standalone validator is the executable called `spirv-val`, and is located in
618*03ce13f7SAndroid Build Coastguard Worker`<spirv-build-dir>/tools/spirv-val`. The functionality of the validator is implemented
619*03ce13f7SAndroid Build Coastguard Workerby the `spvValidate` library function.
620*03ce13f7SAndroid Build Coastguard Worker
621*03ce13f7SAndroid Build Coastguard WorkerThe validator operates on the binary form.
622*03ce13f7SAndroid Build Coastguard Worker
623*03ce13f7SAndroid Build Coastguard Worker* `spirv-val` - the standalone validator
624*03ce13f7SAndroid Build Coastguard Worker  * `<spirv-dir>/tools/val`
625*03ce13f7SAndroid Build Coastguard Worker
626*03ce13f7SAndroid Build Coastguard Worker### Reducer tool
627*03ce13f7SAndroid Build Coastguard Worker
628*03ce13f7SAndroid Build Coastguard WorkerThe reducer shrinks a SPIR-V binary module, guided by a user-supplied
629*03ce13f7SAndroid Build Coastguard Worker*interestingness test*.
630*03ce13f7SAndroid Build Coastguard Worker
631*03ce13f7SAndroid Build Coastguard WorkerThis is a work in progress, with initially only shrinks a module in a few ways.
632*03ce13f7SAndroid Build Coastguard Worker
633*03ce13f7SAndroid Build Coastguard Worker* `spirv-reduce` - the standalone reducer
634*03ce13f7SAndroid Build Coastguard Worker  * `<spirv-dir>/tools/reduce`
635*03ce13f7SAndroid Build Coastguard Worker
636*03ce13f7SAndroid Build Coastguard WorkerRun `spirv-reduce --help` to see how to specify interestingness.
637*03ce13f7SAndroid Build Coastguard Worker
638*03ce13f7SAndroid Build Coastguard Worker### Fuzzer tool
639*03ce13f7SAndroid Build Coastguard Worker
640*03ce13f7SAndroid Build Coastguard WorkerThe fuzzer transforms a SPIR-V binary module into a semantically-equivalent
641*03ce13f7SAndroid Build Coastguard WorkerSPIR-V binary module by applying transformations in a randomized fashion.
642*03ce13f7SAndroid Build Coastguard Worker
643*03ce13f7SAndroid Build Coastguard WorkerThis is a work in progress, with initially only a few semantics-preserving
644*03ce13f7SAndroid Build Coastguard Workertransformations.
645*03ce13f7SAndroid Build Coastguard Worker
646*03ce13f7SAndroid Build Coastguard Worker* `spirv-fuzz` - the standalone fuzzer
647*03ce13f7SAndroid Build Coastguard Worker  * `<spirv-dir>/tools/fuzz`
648*03ce13f7SAndroid Build Coastguard Worker
649*03ce13f7SAndroid Build Coastguard WorkerRun `spirv-fuzz --help` for a detailed list of options.
650*03ce13f7SAndroid Build Coastguard Worker
651*03ce13f7SAndroid Build Coastguard Worker### Control flow dumper tool
652*03ce13f7SAndroid Build Coastguard Worker
653*03ce13f7SAndroid Build Coastguard WorkerThe control flow dumper prints the control flow graph for a SPIR-V module as a
654*03ce13f7SAndroid Build Coastguard Worker[GraphViz](http://www.graphviz.org/) graph.
655*03ce13f7SAndroid Build Coastguard Worker
656*03ce13f7SAndroid Build Coastguard WorkerThis is experimental.
657*03ce13f7SAndroid Build Coastguard Worker
658*03ce13f7SAndroid Build Coastguard Worker* `spirv-cfg` - the control flow graph dumper
659*03ce13f7SAndroid Build Coastguard Worker  * `<spirv-dir>/tools/cfg`
660*03ce13f7SAndroid Build Coastguard Worker
661*03ce13f7SAndroid Build Coastguard Worker### Diff tool
662*03ce13f7SAndroid Build Coastguard Worker
663*03ce13f7SAndroid Build Coastguard Worker*Warning:* This functionality is under development, and is incomplete.
664*03ce13f7SAndroid Build Coastguard Worker
665*03ce13f7SAndroid Build Coastguard WorkerThe diff tool produces a diff-style comparison between two SPIR-V modules.
666*03ce13f7SAndroid Build Coastguard Worker
667*03ce13f7SAndroid Build Coastguard Worker* `spirv-diff` - the standalone diff tool
668*03ce13f7SAndroid Build Coastguard Worker  * `<spirv-dir>`/tools/diff`
669*03ce13f7SAndroid Build Coastguard Worker
670*03ce13f7SAndroid Build Coastguard Worker### Utility filters
671*03ce13f7SAndroid Build Coastguard Worker
672*03ce13f7SAndroid Build Coastguard Worker* `spirv-lesspipe.sh` - Automatically disassembles `.spv` binary files for the
673*03ce13f7SAndroid Build Coastguard Worker  `less` program, on compatible systems.  For example, set the `LESSOPEN`
674*03ce13f7SAndroid Build Coastguard Worker  environment variable as follows, assuming both `spirv-lesspipe.sh` and
675*03ce13f7SAndroid Build Coastguard Worker  `spirv-dis` are on your executable search path:
676*03ce13f7SAndroid Build Coastguard Worker  ```
677*03ce13f7SAndroid Build Coastguard Worker   export LESSOPEN='| spirv-lesspipe.sh "%s"'
678*03ce13f7SAndroid Build Coastguard Worker  ```
679*03ce13f7SAndroid Build Coastguard Worker  Then you page through a disassembled module as follows:
680*03ce13f7SAndroid Build Coastguard Worker  ```
681*03ce13f7SAndroid Build Coastguard Worker  less foo.spv
682*03ce13f7SAndroid Build Coastguard Worker  ```
683*03ce13f7SAndroid Build Coastguard Worker  * The `spirv-lesspipe.sh` script will pass through any extra arguments to
684*03ce13f7SAndroid Build Coastguard Worker    `spirv-dis`.  So, for example, you can turn off colours and friendly ID
685*03ce13f7SAndroid Build Coastguard Worker    naming as follows:
686*03ce13f7SAndroid Build Coastguard Worker    ```
687*03ce13f7SAndroid Build Coastguard Worker    export LESSOPEN='| spirv-lesspipe.sh "%s" --no-color --raw-id'
688*03ce13f7SAndroid Build Coastguard Worker    ```
689*03ce13f7SAndroid Build Coastguard Worker
690*03ce13f7SAndroid Build Coastguard Worker* [vim-spirv](https://github.com/kbenzie/vim-spirv) - A vim plugin which
691*03ce13f7SAndroid Build Coastguard Worker  supports automatic disassembly of `.spv` files using the `:edit` command and
692*03ce13f7SAndroid Build Coastguard Worker  assembly using the `:write` command. The plugin also provides additional
693*03ce13f7SAndroid Build Coastguard Worker  features which include; syntax highlighting; highlighting of all ID's matching
694*03ce13f7SAndroid Build Coastguard Worker  the ID under the cursor; and highlighting errors where the `Instruction`
695*03ce13f7SAndroid Build Coastguard Worker  operand of `OpExtInst` is used without an appropriate `OpExtInstImport`.
696*03ce13f7SAndroid Build Coastguard Worker
697*03ce13f7SAndroid Build Coastguard Worker* `50spirv-tools.el` - Automatically disassembles '.spv' binary files when
698*03ce13f7SAndroid Build Coastguard Worker  loaded into the emacs text editor, and re-assembles them when saved,
699*03ce13f7SAndroid Build Coastguard Worker  provided any modifications to the file are valid.  This functionality
700*03ce13f7SAndroid Build Coastguard Worker  must be explicitly requested by defining the symbol
701*03ce13f7SAndroid Build Coastguard Worker  SPIRV_TOOLS_INSTALL_EMACS_HELPERS as follows:
702*03ce13f7SAndroid Build Coastguard Worker  ```
703*03ce13f7SAndroid Build Coastguard Worker  cmake -DSPIRV_TOOLS_INSTALL_EMACS_HELPERS=true ...
704*03ce13f7SAndroid Build Coastguard Worker  ```
705*03ce13f7SAndroid Build Coastguard Worker
706*03ce13f7SAndroid Build Coastguard Worker  In addition, this helper is only installed if the directory /etc/emacs/site-start.d
707*03ce13f7SAndroid Build Coastguard Worker  exists, which is typically true if emacs is installed on the system.
708*03ce13f7SAndroid Build Coastguard Worker
709*03ce13f7SAndroid Build Coastguard Worker  Note that symbol IDs are not currently preserved through a load/edit/save operation.
710*03ce13f7SAndroid Build Coastguard Worker  This may change if the ability is added to spirv-as.
711*03ce13f7SAndroid Build Coastguard Worker
712*03ce13f7SAndroid Build Coastguard Worker
713*03ce13f7SAndroid Build Coastguard Worker### Tests
714*03ce13f7SAndroid Build Coastguard Worker
715*03ce13f7SAndroid Build Coastguard WorkerTests are only built when googletest is found.
716*03ce13f7SAndroid Build Coastguard Worker
717*03ce13f7SAndroid Build Coastguard Worker#### Running test with CMake
718*03ce13f7SAndroid Build Coastguard Worker
719*03ce13f7SAndroid Build Coastguard WorkerUse `ctest -j <num threads>` to run all the tests. To run tests using all threads:
720*03ce13f7SAndroid Build Coastguard Worker```shell
721*03ce13f7SAndroid Build Coastguard Workerctest -j$(nproc)
722*03ce13f7SAndroid Build Coastguard Worker```
723*03ce13f7SAndroid Build Coastguard Worker
724*03ce13f7SAndroid Build Coastguard WorkerTo run a single test target, use `ctest [-j <N>] -R <test regex>`. For example,
725*03ce13f7SAndroid Build Coastguard Workeryou can run all `opt` tests with:
726*03ce13f7SAndroid Build Coastguard Worker```shell
727*03ce13f7SAndroid Build Coastguard Workerctest -R 'spirv-tools-test_opt'
728*03ce13f7SAndroid Build Coastguard Worker```
729*03ce13f7SAndroid Build Coastguard Worker
730*03ce13f7SAndroid Build Coastguard Worker#### Running test with Bazel
731*03ce13f7SAndroid Build Coastguard Worker
732*03ce13f7SAndroid Build Coastguard WorkerUse `bazel test :all` to run all tests. This will run tests in parallel by default.
733*03ce13f7SAndroid Build Coastguard Worker
734*03ce13f7SAndroid Build Coastguard WorkerTo run a single test target, specify `:my_test_target` instead of `:all`. Test target
735*03ce13f7SAndroid Build Coastguard Workernames get printed when you run `bazel test :all`. For example, you can run
736*03ce13f7SAndroid Build Coastguard Worker`opt_def_use_test` with:
737*03ce13f7SAndroid Build Coastguard Worker
738*03ce13f7SAndroid Build Coastguard Workeron linux:
739*03ce13f7SAndroid Build Coastguard Worker```shell
740*03ce13f7SAndroid Build Coastguard Workerbazel test --cxxopt=-std=c++17 :opt_def_use_test
741*03ce13f7SAndroid Build Coastguard Worker```
742*03ce13f7SAndroid Build Coastguard Worker
743*03ce13f7SAndroid Build Coastguard Workeron windows:
744*03ce13f7SAndroid Build Coastguard Worker```shell
745*03ce13f7SAndroid Build Coastguard Workerbazel test --cxxopt=/std:c++17 :opt_def_use_test
746*03ce13f7SAndroid Build Coastguard Worker```
747*03ce13f7SAndroid Build Coastguard Worker
748*03ce13f7SAndroid Build Coastguard Worker## Future Work
749*03ce13f7SAndroid Build Coastguard Worker<a name="future"></a>
750*03ce13f7SAndroid Build Coastguard Worker
751*03ce13f7SAndroid Build Coastguard Worker_See the [projects pages](https://github.com/KhronosGroup/SPIRV-Tools/projects)
752*03ce13f7SAndroid Build Coastguard Workerfor more information._
753*03ce13f7SAndroid Build Coastguard Worker
754*03ce13f7SAndroid Build Coastguard Worker### Assembler and disassembler
755*03ce13f7SAndroid Build Coastguard Worker
756*03ce13f7SAndroid Build Coastguard Worker* The disassembler could emit helpful annotations in comments.  For example:
757*03ce13f7SAndroid Build Coastguard Worker  * Use variable name information from debug instructions to annotate
758*03ce13f7SAndroid Build Coastguard Worker    key operations on variables.
759*03ce13f7SAndroid Build Coastguard Worker  * Show control flow information by annotating `OpLabel` instructions with
760*03ce13f7SAndroid Build Coastguard Worker    that basic block's predecessors.
761*03ce13f7SAndroid Build Coastguard Worker* Error messages could be improved.
762*03ce13f7SAndroid Build Coastguard Worker
763*03ce13f7SAndroid Build Coastguard Worker### Validator
764*03ce13f7SAndroid Build Coastguard Worker
765*03ce13f7SAndroid Build Coastguard WorkerThis is a work in progress.
766*03ce13f7SAndroid Build Coastguard Worker
767*03ce13f7SAndroid Build Coastguard Worker### Linker
768*03ce13f7SAndroid Build Coastguard Worker
769*03ce13f7SAndroid Build Coastguard Worker* The linker could accept math transformations such as allowing MADs, or other
770*03ce13f7SAndroid Build Coastguard Worker  math flags passed at linking-time in OpenCL.
771*03ce13f7SAndroid Build Coastguard Worker* Linkage attributes can not be applied through a group.
772*03ce13f7SAndroid Build Coastguard Worker* Check decorations of linked functions attributes.
773*03ce13f7SAndroid Build Coastguard Worker* Remove dead instructions, such as OpName targeting imported symbols.
774*03ce13f7SAndroid Build Coastguard Worker
775*03ce13f7SAndroid Build Coastguard Worker## Licence
776*03ce13f7SAndroid Build Coastguard Worker<a name="license"></a>
777*03ce13f7SAndroid Build Coastguard WorkerFull license terms are in [LICENSE](LICENSE)
778*03ce13f7SAndroid Build Coastguard Worker```
779*03ce13f7SAndroid Build Coastguard WorkerCopyright (c) 2015-2016 The Khronos Group Inc.
780*03ce13f7SAndroid Build Coastguard Worker
781*03ce13f7SAndroid Build Coastguard WorkerLicensed under the Apache License, Version 2.0 (the "License");
782*03ce13f7SAndroid Build Coastguard Workeryou may not use this file except in compliance with the License.
783*03ce13f7SAndroid Build Coastguard WorkerYou may obtain a copy of the License at
784*03ce13f7SAndroid Build Coastguard Worker
785*03ce13f7SAndroid Build Coastguard Worker    http://www.apache.org/licenses/LICENSE-2.0
786*03ce13f7SAndroid Build Coastguard Worker
787*03ce13f7SAndroid Build Coastguard WorkerUnless required by applicable law or agreed to in writing, software
788*03ce13f7SAndroid Build Coastguard Workerdistributed under the License is distributed on an "AS IS" BASIS,
789*03ce13f7SAndroid Build Coastguard WorkerWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
790*03ce13f7SAndroid Build Coastguard WorkerSee the License for the specific language governing permissions and
791*03ce13f7SAndroid Build Coastguard Workerlimitations under the License.
792*03ce13f7SAndroid Build Coastguard Worker```
793*03ce13f7SAndroid Build Coastguard Worker
794*03ce13f7SAndroid Build Coastguard Worker[spirv-tools-cla]: https://cla-assistant.io/KhronosGroup/SPIRV-Tools
795*03ce13f7SAndroid Build Coastguard Worker[spirv-tools-projects]: https://github.com/KhronosGroup/SPIRV-Tools/projects
796*03ce13f7SAndroid Build Coastguard Worker[spirv-tools-mailing-list]: https://www.khronos.org/spir/spirv-tools-mailing-list
797*03ce13f7SAndroid Build Coastguard Worker[spirv-registry]: https://www.khronos.org/registry/spir-v/
798*03ce13f7SAndroid Build Coastguard Worker[spirv-headers]: https://github.com/KhronosGroup/SPIRV-Headers
799*03ce13f7SAndroid Build Coastguard Worker[googletest]: https://github.com/google/googletest
800*03ce13f7SAndroid Build Coastguard Worker[googletest-pull-612]: https://github.com/google/googletest/pull/612
801*03ce13f7SAndroid Build Coastguard Worker[googletest-issue-610]: https://github.com/google/googletest/issues/610
802*03ce13f7SAndroid Build Coastguard Worker[effcee]: https://github.com/google/effcee
803*03ce13f7SAndroid Build Coastguard Worker[re2]: https://github.com/google/re2
804*03ce13f7SAndroid Build Coastguard Worker[abseil-cpp]: https://github.com/abseil/abseil-cpp
805*03ce13f7SAndroid Build Coastguard Worker[CMake]: https://cmake.org/
806*03ce13f7SAndroid Build Coastguard Worker[cpp-style-guide]: https://google.github.io/styleguide/cppguide.html
807*03ce13f7SAndroid Build Coastguard Worker[clang-sanitizers]: http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
808