Update SPIR-V Tools to 51892874b

    51892874b Run ADCE when the printf extension is used. (#5215)
    e803fe671 Don't convert struct members to half (#5201)
    d6310f416 Roll external/googletest/ a3580180d..bc860af08 (1 commit) (#5216)
    8993f9f52 Apply scalar replacement on vars with Pointer decorations (#5208)
    01055c60c Update the contributing guidelines (#5212)
    65f03bea4 Roll external/spirv-headers/ 7f1d2f415..268a06176 (2 commits) (#5214)
    2189ad7a5 spirv-tools: Add support for QNX (#5211)
    17be6bb7c Roll external/googletest/ f345b2ca6..a3580180d (2 commits) (#5210)
    a525dccbe roll deps (#5209)
    0ce36ad78 instrument: Add set and binding to bindless error records (#5204)
    08d8fae58 Roll external/googletest/ 0bdaac5a1..797b0ad2a (1 commit) (#5207)
    8e1001e93 Roll external/googletest/ dea0484e4..0bdaac5a1 (1 commit) (#5206)
    baa46e103 Update spirv_headers to include SPV_KHR_ray_tracing_position_fetch (#5205)
    6110f30a3 Roll external/googletest/ 783d00fd1..ccdeec888 (1 commit) (#5203)
    d4c0abdca instrument: Change descriptor state storage format (#5178)
    9e627132a Roll external/googletest/ 12a5852e4..783d00fd1 (9 commits) (#5198)
    25ad5e19f Do not define GOOGLE_PROTOBUF_INTERNAL_DONATE_STEAL_INLINE if it is already defined. (#5200)
    bec566a32 opt: Fix null deref in OpMatrixTimesVector and OpVectorTimesMatrix (#5199)
    d5f69dba5 Remove dead code (#5195)
    55bc37f82 Roll external/googletest/ 8fa9461cc..12a5852e4 (1 commit) (#5193)
    6f276e05c Add support for SPV_EXT_shader_tile_image (#5188)
    1877a7f90 Fix vector OpConstantComposite type validation (#5191)
    f449fb4ad Add default case for spv::Dim for TileImageEXT (#5194)
    9a4e7a1eb Update protobuf to v21.12 (#5189)
    31c546e31 Roll external/googletest/ 057b4e904..8fa9461cc (2 commits) (#5192)
    048faf2e5 Remove use of deprecated std::aligned_storage (#5183)
    13ea01b3e Roll external/googletest/ 7ee260c54..057b4e904 (1 commit) (#5190)
    dd03c1fca Fix LICMPass (#5087)
    97a55196d Roll external/googletest/ b5fd99bbd..7ee260c54 (1 commit) (#5187)
    ac335c763 roll deps (#5185)
    a2db3fb17 kokoro: always chown files (#5186)
    6b72fe20c Add missing header guard (#5181)
    7ab0a2781 Remove non-ascii char from comments. (#5182)
    f5ff7ae4a Roll external/googletest/ 88af49efa..ca0d46e95 (4 commits) (#5180)
    a0fcd06f8 Add Vulkan memory model to allow lists (#5173)
    d8a8af8e6 spirv-val: Remove unused includes and code (#5176)
    4680d2bef Roll external/googletest/ e9fb5c7ba..88af49efa (1 commit) (#5179)
    fa69b09cf spirv-opt: Remove unused includes and code (#5177)
    d24a39a7f Do not remove control barrier after spv1.3 (#5174)
    f9f31fa5a Roll external/googletest/ 6f01e3dc1..e9fb5c7ba (2 commits) (#5175)
    b4e0850ef Ignore NonSemanticInstructions (#5171)
    32a4d840b roll deps (#5172)
    9fbe1738b Update SPIRV-Headers deps (#5170)
    5f4e694e1 Implement source extraction logic for spirv-objdump (#5150)
    5aab2a8fe Include stdint.h (#5164)
    1a52c14ee Roll external/googletest/ fa8720982..974e18ee6 (2 commits) (#5168)
    90f6a2875 Roll external/googletest/ 471087fbf..fa8720982 (2 commits) (#5167)
    4dc3edeb9 build: set std=c++17 for BUILD.gn (#5162)
    f56f2b6fd roll deps (#5166)
    9c9144b65 ci: fix dependency updater bot (#5165)
    ae435df4a git: add release workflow (#5158)
    44bc9bd2a build: cmake: support passing a custom source folder for GoogleTest (#5157)
    8e6563b91 spirv-val: Label new Vulkan VUID 07951 (#5154)
    9743701ed Explicitly #include <utility> in spirv_target_env.cpp (#5159)
    25f6c0cea Revert "Add workflow for github releases. (#5145)" (#5156)
    a45a4cd21 Roll external/googletest/ 038e392eb..391ce627d (1 commit) (#5153)
    a1f555651 build(deps): bump y18n from 4.0.0 to 4.0.3 in /tools/sva (#5155)
    25b7608cb Add workflow for github releases. (#5145)
    fcd53c8ed Add spirv-dump tool (#5146)
    7cefd5f5f Change default permissions for workflows (#5149)
    44d72a9b3 Prepare release v2023.2 (#5151)
    fba26fd60 roll deps (#5152)
    01828dac7 Roll external/googletest/ 48a1b1105..50e07d1c9 (1 commit) (#5148)
    b029037aa Revert changes around CHANGES file. (#5143)
    c069a5c7e roll deps (#5144)
    42267721e build: tool to generate a CHANGELOG from tags (#5136)
    db0c3d83d Roll external/googletest/ e1ee0fa3e..a798c2f10 (4 commits) (#5142)
    690a9a406 Add explicit deduction guide for FlagRegistration (#5141)
    3033cf428 Roll external/googletest/ cead3d57c..e1ee0fa3e (9 commits) (#5140)
    016bb3ae7 roll deps (#5139)
    7cb5898e1 diff: refactorize flag parsing (#5133)
    e0df12997 Fix using invalid install path for cmake support files with MINGW platform (#5128) (#5129)
    3eff21366 Fix MinGW build error (#4935) (#5127)
    bd83b772c Fix operand index out of bounds when folding OpCompositeExtract. (#5107)
    5fe3bbe77 Update Effcee so it doesn't hardcode C++11 (#5137)
    6c714f191 Roll external/googletest/ c7d0bc830..2d4f20876 (3 commits) (#5130)
    d6c707676 linter: refactorize linter flag parsing (#5134)
    8cee46198 tools: add uint32_t flags parsing (#5131)
    970ba4e8b linker: refactorize flag parsing (#5132)
    9d71fb676 Roll external/googletest/ 3d787f5a0..c7d0bc830 (4 commits) (#5126)
    9d4c95a57 build: fix build.gn missing comma (#5125)
    2e0f4b52c tools: refactorize tools flags parsing. (#5111)
    3b2ea1a42 Roll external/googletest/ 39a26e12d..3d787f5a0 (2 commits) (#5123)
    b955c468b Add missing header include (#5124)
    5d2bc6f06 Fix removal of dependent non-semantic instructions (#5122)
    4183faa2e Roll external/googletest/ 750d67d80..39a26e12d (2 commits) (#5120)
    2cf48e953 Allow invoking git.bat as git on Windows (#5118)
    9017cfcf6 Roll external/googletest/ 7a7231c44..750d67d80 (1 commit) (#5119)
    8bcaad28f Roll external/re2/ 9049cd28d..3a8436ac4 (1 commit) (#5117)
    987a5f136 build: change the way we set cxx version for bazel. (#5114)
    69ed5adf1 Roll external/googletest/ f063cd25c..7a7231c44 (1 commit) (#5116)
    c9947cc8d Roll external/googletest/ 2057566e4..f063cd25c (1 commit) (#5115)
    956114df2 opt: fix spirv ABI on Linux again. (#5113)
    f4343515a Remove duplicate lists of constant and type opcodes (#5106)
    95f93810b Roll external/googletest/ b80a07ffe..2057566e4 (1 commit) (#5112)
    b84c86f71 libspirv.cpp: adds c++ api for spvBinaryParse (#5109)
    e150e716f roll deps (#5110)
    722138136 Roll external/re2/ b025c6a3a..891fa6684 (1 commit) (#5108)
    5b48c549b Roll external/googletest/ 0570e2d93..b73f27fd1 (1 commit) (#5105)
    dfcbf310a Change exec_tools -> tools for local genrule (#5104)
    b0504f990 Roll external/googletest/ 3d568bdda..0570e2d93 (2 commits) (#5102)
    c965624e3 Roll external/googletest/ 2f2e72bae..3d568bdda (1 commit) (#5100)
    0ce2bc4ce spirv-val: Conditional Branch without an exit is invalid in loop header (#5069)


Bug: b/123642959
Change-Id: Iff1092d95e7753f15c123968abe658a6d5f5e891
tree: 6af4d527b556c33d6ef0378aad16244bf023029b
  1. .vscode/
  2. build/
  3. build_overrides/
  4. docs/
  5. include/
  6. infra/
  7. src/
  8. tests/
  9. third_party/
  10. tools/
  11. .clang-format
  12. .dir-locals.el
  13. .gitignore
  14. .gitmodules
  15. Android.bp
  16. AUTHORS.txt
  17. BUILD.gn
  18. CMakeLists.txt
  19. CMakeSettings.json
  20. codereview.settings
  24. LICENSE.txt
  25. OWNERS
  26. README.md




SwiftShader[^1] is a high-performance CPU-based implementation[^2] of the Vulkan[^3] 1.3 graphics API. Its goal is to provide hardware independence for advanced 3D graphics.

NOTE: The ANGLE project can be used to achieve a layered implementation[^4] of OpenGL ES 3.1 (aka. “SwANGLE”).


SwiftShader libraries can be built for Windows, Linux, and macOS.
Android and Chrome (OS) build environments are also supported.

  • CMake
    Install CMake for Linux, macOS, or Windows and use either the GUI or run the following terminal commands:

    cd build
    cmake ..
    cmake --build . --parallel

    Tip: Set the CMAKE_BUILD_PARALLEL_LEVEL environment variable to control the level of parallelism.

  • Visual Studio
    To build the Vulkan ICD library, use Visual Studio 2019 to open the project folder and wait for it to run CMake. Open the CMake Targets View in the Solution Explorer and select the vk_swiftshader project to build it.


The SwiftShader libraries act as drop-in replacements for graphics drivers.

On Windows, most applications can be made to use SwiftShader's DLLs by placing them in the same folder as the executable. On Linux, the LD_LIBRARY_PATH environment variable or -rpath linker option can be used to direct applications to search for shared libraries in the indicated directory first.

In general, Vulkan applications look for a shared library named vulkan-1.dll on Windows (vulkan-1.so on Linux). This ‘loader’ library then redirects API calls to the actual Installable Client Driver (ICD). SwiftShader's ICD is named libvk_swiftshader.dll, but it can be renamed to vulkan-1.dll to be loaded directly by the application. Alternatively, you can set the VK_ICD_FILENAMES environment variable to the path to vk_swiftshader_icd.json file that is generated under the build directory (e.g. .\SwiftShader\build\Windows\vk_swiftshader_icd.json). To learn more about how Vulkan loading works, read the official documentation here.


See CONTRIBUTING.txt for important contributing requirements.

The canonical repository for SwiftShader is hosted at: https://swiftshader.googlesource.com/SwiftShader.

All changes must be reviewed and approved in the Gerrit review tool at: https://swiftshader-review.googlesource.com. You must sign in to this site with a Google Account before changes can be uploaded.

Next, authenticate your account here: https://swiftshader.googlesource.com/new-password (use the same e-mail address as the one configured as the Git commit author).

All changes require a Change-ID tag in the commit message. A commit hook may be used to add this tag automatically, and can be found at: https://gerrit-review.googlesource.com/tools/hooks/commit-msg. You can execute git clone https://swiftshader.googlesource.com/SwiftShader and manually place the commit hook in SwiftShader/.git/hooks/, or to clone the repository and install the commit hook in one go:

git clone https://swiftshader.googlesource.com/SwiftShader && (cd SwiftShader && git submodule update --init --recursive third_party/git-hooks && ./third_party/git-hooks/install_hooks.sh)

On Windows, this command line requires using the Git Bash Shell.

Changes are uploaded to Gerrit by executing:

git push origin HEAD:refs/for/master

When ready, add a project owner as a reviewer on your change.

Some tests will automatically be run against the change. Notably, presubmit.sh verifies the change has been formatted using clang-format 11.0.1. Most IDEs come with clang-format support, but may require upgrading/downgrading to the clang-format version 11.0.0 release version (notably Chromium's buildtools has a clang-format binary which can be an in-between revision which produces different formatting results).


SwiftShader's Vulkan implementation can be tested using the dEQP test suite.

See docs/dEQP.md for details.

Third-Party Dependencies

The third_party directory contains projects which originated outside of SwiftShader:

subzero contains a fork of the Subzero project. It originates from Google Chrome‘s (Portable) Native Client project. The fork was made using git-subtree to include all of Subzero’s history.

llvm-subzero contains a minimized set of LLVM dependencies of the Subzero project.

PowerVR_SDK contains a subset of the PowerVR Graphics Native SDK for running several sample applications.

googletest contains the Google Test project, as a Git submodule. It is used for running unit tests for Chromium, and Reactor unit tests. Run git submodule update --init to obtain/update the code. Any contributions should be made upstream.


See docs/Index.md.


Public mailing list: swiftshader@googlegroups.com

General bug tracker: https://g.co/swiftshaderbugs
Chrome specific bugs: https://bugs.chromium.org/p/swiftshader


The SwiftShader project is licensed under the Apache License Version 2.0. You can find a copy of it in LICENSE.txt.

Files in the third_party folder are subject to their respective license.

Authors and Contributors

The legal authors for copyright purposes are listed in AUTHORS.txt.

CONTRIBUTORS.txt contains a list of names of individuals who have contributed to SwiftShader. If you‘re not on the list, but you’ve signed the Google CLA and have contributed more than a formatting change, feel free to request to be added.

Notes and Disclaimers

[^1]: This is not an official Google product.
[^2]: Vulkan 1.3 conformance: https://www.khronos.org/conformance/adopters/conformant-products#submission_717
[^3]: Trademarks are the property of their respective owners.
[^4]: OpenGL ES 3.1 conformance: https://www.khronos.org/conformance/adopters/conformant-products/opengles#submission_906