Update README (#3047)

* This project supports SPIR-V 1.5
* Update description of the optimizer
This commit is contained in:
David Neto 2019-11-14 09:38:01 -05:00 committed by GitHub
parent 1f2af55f21
commit c3f22f7cba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,9 +49,11 @@ version. An API call reports the software version as a C-style string.
### Assembler, binary parser, and disassembler ### Assembler, binary parser, and disassembler
* Support for SPIR-V 1.0, 1.1, 1.2, and 1.3 * Support for SPIR-V 1.0, through 1.5
* Based on SPIR-V syntax described by JSON grammar files in the * Based on SPIR-V syntax described by JSON grammar files in the
[SPIRV-Headers](https://github.com/KhronosGroup/SPIRV-Headers) repository. [SPIRV-Headers](https://github.com/KhronosGroup/SPIRV-Headers) repository.
* Usually, support for a new version of SPIR-V is ready within days after
publication.
* Support for extended instruction sets: * Support for extended instruction sets:
* GLSL std450 version 1.0 Rev 3 * GLSL std450 version 1.0 Rev 3
* OpenCL version 1.0 Rev 2 * OpenCL version 1.0 Rev 2
@ -88,14 +90,22 @@ limits accepted by a more than minimally capable SPIR-V consumer.
### Optimizer ### Optimizer
*Note:* The optimizer is still under development. The optimizer is a collection of code transforms, or "passes".
Transforms are written for a diverse set of reasons:
Currently supported optimizations: * To restructure, simplify, or normalize the code for further processing.
* General * To eliminate undesirable code.
* To improve code quality in some metric such as size or performance.
**Note**: These transforms are not guaranteed to actually improve any
given metric. Users should always measure results for their own situation.
As of this writing, there are 67 transforms including examples such as:
* Simplification
* Strip debug info * Strip debug info
* Strip reflection info
* Specialization Constants * Specialization Constants
* Set spec constant default value * Set spec constant default value
* Freeze spec constant * Freeze spec constant to default value
* Fold `OpSpecConstantOp` and `OpSpecConstantComposite` * Fold `OpSpecConstantOp` and `OpSpecConstantComposite`
* Unify constants * Unify constants
* Eliminate dead constant * Eliminate dead constant
@ -112,6 +122,29 @@ Currently supported optimizations:
* Eliminate common uniform loads * Eliminate common uniform loads
* Remove duplicates: Capabilities, extended instruction imports, types, and * Remove duplicates: Capabilities, extended instruction imports, types, and
decorations. decorations.
* Normalization
* Compact IDs
* CFG cleanup
* Flatten decorations
* Merge returns
* Convert AMD-specific instructions to KHR instructions
* Code improvement
* Conditional constant propagation
* If-conversion
* Loop fission
* Loop fusion
* Loop-invariant code motion
* Loop unroll
* Other
* Generate WebGPU initializers
* Graphics robust access
* Upgrade memory model to VulkanKHR
Additionally, certain sets of transformations have been packaged into
higher-level recipes. These include:
* Optimization for size (`spirv-opt -Os`)
* Optimization for performance (`spirv-opt -O`)
For the latest list with detailed documentation, please refer to For the latest list with detailed documentation, please refer to
[`include/spirv-tools/optimizer.hpp`](include/spirv-tools/optimizer.hpp). [`include/spirv-tools/optimizer.hpp`](include/spirv-tools/optimizer.hpp).