Roll third_party/spirv-tools/ 8e3da01b4..ee7598d49 (36 commits)

https://github.com/KhronosGroup/SPIRV-Tools/compare/8e3da01b4580...ee7598d49798

$ git log 8e3da01b4..ee7598d49 --date=short --no-merges --format='%ad %ae %s'
2023-09-20 jeremyg instrument: Use Import linkage for instrumentation functions (#5355)
2023-09-20 stevenperron roll deps (#5408)
2023-09-13 dneto Update SPIRV-Headers, add cache control operand kinds (#5406)
2023-09-11 stevenperron Change autoroll pr review id (#5404)
2023-09-11 andre Check for git repository before git commands (#5403)
2023-09-11 cbeckley Make sure that fragment shader interlock instructions are not removed by DCE (#5400)
2023-09-11 41898282+github-actions[bot] Roll external/re2/ e0077036c..a807e8a3a (6 commits) (#5401)
2023-09-07 brioche val: re-add ImageMSArray validation (#5394)
2023-09-06 stevenperron Add SPV_KHR_physical_storage_buffer to allowlists (#5402)
2023-09-05 stevenperron Fix `AddMemberDecoration` variable names. (#5399)
2023-09-05 brioche opt: add ImageMSArray capability to trim pass. (#5395)
2023-09-05 cbeckley Add SPV_EXT_fragment_shader_interlock to allow lists (#5393)
2023-09-05 brioche opt: add raytracing/rayquery to trim pass (#5397)
2023-09-05 41898282+github-actions[bot] Roll external/re2/ 523f9b097..e0077036c (2 commits) (#5391)
2023-09-05 brioche opt: add Int64 capability to trim pass (#5398)
2023-09-04 brioche NFC: rename tests using capability as prefix (#5396)
2023-09-04 cbeckley opt: add FragmentShader*InterlockEXT to capability trim pass (#5390)
2023-08-30 74101708+mgorchak-blackberry QNX has support for ANSI ESC codes, default terminal is QANSI. (#5387)
2023-08-30 joycebrum Enable OpenSSF Scorecard and Badge (#5377)
2023-08-30 41898282+github-actions[bot] Roll external/re2/ 73031bbc0..523f9b097 (1 commit) (#5389)
2023-08-29 41898282+github-actions[bot] Roll external/googletest/ 460ae9826..8a6feabf0 (1 commit) (#5388)
2023-08-24 41898282+github-actions[bot] roll deps (#5386)
2023-08-23 41898282+github-actions[bot] roll deps (#5384)
2023-08-22 41898282+github-actions[bot] Roll external/googletest/ 9fce54804..61332bd7e (2 commits) (#5383)
2023-08-21 jeremyg opt: Add SwitchDescriptorSetPass (#5375)
2023-08-21 jeremyg linker: Add --use-highest-version option (#5376)
2023-08-19 41898282+github-actions[bot] roll deps (#5382)
2023-08-16 41898282+github-actions[bot] Roll external/googletest/ 7e33b6a1c..987e22561 (5 commits) (#5381)
2023-08-15 quic_wooykim SPV_QCOM_image_processing support (#5223)
2023-08-15 stevenperron Fix failing action when PR is already open. (#5380)
2023-08-15 brioche opt: add bitmask support for capability trimming (#5372)
2023-08-14 41898282+github-actions[bot] Roll external/re2/ 9dc7ae7b5..6148386f0 (3 commits) (#5379)
2023-08-11 viktoria.maksimova Support 2 Intel extensions (#5357)
2023-08-11 41898282+github-actions[bot] roll deps (#5374)
2023-08-10 rharrison Fix -Wunreachable-code-loop-increment warning (#5373)
2023-08-10 brioche enable StorageUniform16 (#5371)

Created with:
  roll-dep third_party/spirv-tools
1 file changed
tree: 89119d0bd6dc611045bb336cfc0a85009c0d7d3c
  1. .github/
  2. android_test/
  3. build_overrides/
  4. cmake/
  5. examples/
  6. glslc/
  7. kokoro/
  8. libshaderc/
  9. libshaderc_util/
  10. third_party/
  11. utils/
  12. .clang-format
  13. .gitignore
  14. Android.mk
  15. AUTHORS
  16. BUILD.gn
  17. CHANGES
  18. CMakeLists.txt
  19. CONTRIBUTING.md
  20. CONTRIBUTORS
  21. DEPS
  22. DEVELOPMENT.howto.md
  23. Dockerfile
  24. downloads.md
  25. LICENSE
  26. license-checker.cfg
  27. README.md
README.md

Shaderc

A collection of tools, libraries and tests for shader compilation. At the moment it includes:

  • glslc, a command line compiler for GLSL/HLSL to SPIR-V, and
  • libshaderc, a library API for accessing glslc functionality.

Note: The fact that that libshaderc is not named libshaderc_glslc is a quirk of history, and a known inconsistency. Changing it would require a significant amount of renaming and breaking of downstream projects, so it is being left as is.

glslc wraps around core functionality in glslang and SPIRV-Tools. glslc and its library aims to to provide:

  • a command line compiler with GCC- and Clang-like usage, for better integration with build systems
  • an API where functionality can be added without breaking existing clients
  • an API supporting standard concurrency patterns across multiple operating systems
  • increased functionality such as file #include support

Downloads

Note: These binaries are just the artifacts of the builders and have not undergone any QA, thus they should be considered unsupported.

Linux Build Status MacOS Build Status Windows Build Status

More downloads

Status

Shaderc has maintained backward compatibility for quite some time, and we don't anticipate any breaking changes. Ongoing enhancements are described in the CHANGES file.

Shaderc has been shipping in the Android NDK since version r12b. (The NDK build uses sources from https://android.googlesource.com/platform/external/shaderc/. Those repos are downstream from GitHub.) We currently require r25c.

For licensing terms, please see the LICENSE file. If interested in contributing to this project, please see CONTRIBUTING.md.

This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google. That may change if Shaderc gains contributions from others. See the CONTRIBUTING.md file for more information. See also the AUTHORS and CONTRIBUTORS files.

File organization

  • android_test/ : a small Android application to verify compilation
  • cmake/: CMake utility functions and configuration for Shaderc
  • examples/: Example programs
  • glslc/: an executable to compile GLSL to SPIR-V
  • libshaderc/: a library for compiling shader strings into SPIR-V
  • libshaderc_util/: a utility library used by multiple shaderc components
  • third_party/: third party open source packages; see below
  • utils/: utility scripts for Shaderc

Shaderc depends on glslang, the Khronos reference compiler for GLSL.

Shaderc depends on SPIRV-Tools for assembling, disassembling, and transforming SPIR-V binaries.

For testing, Shaderc depends on: | Library | URL | Description | | -- | -- | -- | | Googletest | https://github.com/google/googletest | Testing framework | | Effcee | https://github.com/google/effcee | Stateful pattern matcher inspired by LLVM's FileCheck | | RE2 | https://github.com/google/re2 | Regular expression matcher | | Abseil | https://github.com/abseil/abseil-cpp | Common basic utilities in C++ |

In the following sections, $SOURCE_DIR is the directory you intend to clone Shaderc into.

Getting and building Shaderc

If you only want prebuilt executables or libraries, see the Downloads section.

The rest of this section describes how to build Shaderc from sources.

Note: Shaderc assumes Glslang supports HLSL compilation. The instructions below assume you‘re building Glslang from sources, and in a subtree of shaderc/third_party. In that scenario, Glslang’s HLSL support is automatically enabled. Shaderc also can be built using a Glslang from outside the shaderc/third_party tree. In that case you must ensure that that external Glslang is built with HLSL functionality. See Glslang's ENABLE_HLSL CMake setting.)

  1. Check out the source code:
git clone https://github.com/google/shaderc $SOURCE_DIR
cd $SOURCE_DIR
./utils/git-sync-deps

Note: The known-good branch of the repository contains a known_good.json file describing a set of repo URLs and specific commits that have been tested together. This information is updated periodically, and typically matches the latest update of these sources in the development branch of the Android NDK. The known-good branch also contains a update_shaderc.py script that will read the JSON file and checkout those specific commits for you.

  1. Ensure you have the requisite tools -- see the tools subsection below.

  2. Decide where to place the build output. In the following steps, we'll call it $BUILD_DIR. Any new directory should work. We recommend building outside the source tree, but it is also common to build in a (new) subdirectory of $SOURCE_DIR, such as $SOURCE_DIR/build.

4a) Build (and test) with Ninja on Linux or Windows:

cd $BUILD_DIR
cmake -GNinja -DCMAKE_BUILD_TYPE={Debug|Release|RelWithDebInfo} $SOURCE_DIR
ninja
ctest # optional

4b) Or build (and test) with MSVC on Windows:

cd $BUILD_DIR
cmake $SOURCE_DIR
cmake --build . --config {Release|Debug|MinSizeRel|RelWithDebInfo}
ctest -C {Release|Debug|MinSizeRel|RelWithDebInfo}

4c) Or build with MinGW on Linux for Windows:

cd $BUILD_DIR
cmake -GNinja -DCMAKE_BUILD_TYPE={Debug|Release|RelWithDebInfo} $SOURCE_DIR \
   -DCMAKE_TOOLCHAIN_FILE=$SOURCE_DIR/cmake/linux-mingw-toolchain.cmake
ninja

After a successful build, you should have a glslc executable somewhere under the $BUILD_DIR/glslc/ directory, as well as a libshaderc library somewhere under the $BUILD_DIR/libshaderc/ directory.

The default behavior on MSVC is to link with the static CRT. If you would like to change this behavior -DSHADERC_ENABLE_SHARED_CRT may be passed on the cmake configure line.

See the libshaderc README for more on using the library API in your project.

Tools you'll need

For building, testing, and profiling Shaderc, the following tools should be installed regardless of your OS:

  • A C++17 compiler. Recent versions of Clang, GCC, and MSVC work.
  • CMake 3.14 or later: for generating compilation targets.
    • Shaderc is tested with cmake 3.17.2
  • Python 3: for utility scripts and running the test suite.

On Linux, if cross compiling to Windows:

  • mingw: A GCC-based cross compiler targeting Windows so that generated executables use the Microsoft C runtime libraries. The MinGW compiler must support C++17.

On Windows, the following tools should be installed and available on your path:

  • Visual Studio 2017 or later. Previous versions of Visual Studio may work but are untested and unsupported.
  • Git - including the associated tools, Bash, diff.

Optionally, the following tools may be installed on any OS:

Building and running Shaderc using Docker

Please make sure you have the Docker engine installed on your machine.

To create a Docker image containing Shaderc command line tools, issue the following command in ${SOURCE_DIR}: docker build -t <IMAGE-NAME> .. The created image will have all the command line tools installed at /usr/local internally, and a data volume mounted at /code.

Assume <IMAGE-NAME> is shaderc/shaderc from now on.

To invoke a tool from the above created image in a Docker container:

docker run shaderc/shaderc glslc --version

Alternatively, you can mount a host directory (e.g., example) containing the shaders you want to manipulate and run different kinds of tools via an interactive shell in the container:

$ docker run -i -t -v `pwd`/example:/code shaderc/shaderc
/code $ ls
test.vert
/code $ glslc -c -o - test.vert | spirv-dis

Bug tracking

We track bugs using GitHub -- click on the “Issues” button on the project's GitHub page.

Bindings

Bindings are maintained by third parties, may contain content offered under a different license, and may reference or contain older versions of Shaderc and its dependencies.