commit | d8eca133b4b18e4fb8b2ab9b9f04dc53d5ce2537 | [log] [tgz] |
---|---|---|
author | Ryan Harrison <rharrison@google.com> | Mon Jun 01 16:51:57 2020 -0400 |
committer | GitHub <noreply@github.com> | Mon Jun 01 16:51:57 2020 -0400 |
tree | a1fc07c9a47945a61c93199191e9c66e9c91be8a | |
parent | da87b8d8b0a1d474655098faea7ffe544764e69e [diff] |
Rolling 5 dependencies (#1078) Roll third_party/glslang/ 2b0eafb1d..d39b8afc4 (4 commits) https://github.com/KhronosGroup/glslang/compare/2b0eafb1de5b...d39b8afc47a1 $ git log 2b0eafb1d..d39b8afc4 --date=short --no-merges --format='%ad %ae %s' 2020-05-28 40001162+alelenv EXT_ray_tracing requires spv1.4 (#2237) 2020-05-28 shuizhuyuanluo fix warning unused parameter in release build (#2251) 2020-05-27 greg Fix missing patch decoration for TessFactor PCF arg (#2249) 2020-05-27 greg Update SPIRV-Tools to stable. Also SPIRV-Headers to TOT. (#2250) Roll third_party/googletest/ 011959aaf..859bfe898 (18 commits) https://github.com/google/googletest/compare/011959aafddc...859bfe8981d6 $ git log 011959aaf..859bfe898 --date=short --no-merges --format='%ad %ae %s' 2020-05-28 dmauro Googletest export 2020-05-28 dmauro Googletest export 2020-05-27 absl-team Googletest export 2020-05-27 dmauro Googletest export 2020-05-19 absl-team Googletest export 2020-05-18 absl-team Googletest export 2020-05-18 durandal Googletest export 2020-05-18 absl-team Googletest export 2020-05-14 absl-team Googletest export 2020-05-25 invalid_ms_user Use count function instead of handwritten loop 2020-05-10 mate.pek README.dm: Renamed related open source project name: Catch2 and Google Test Explorer -> C++ TestMate 2020-03-26 mvoorsluys Fix test with stack. 2020-03-26 mvoorsluys Fixed xml unit-tests and added extra tests 2020-03-26 mvoorsluys Fix multiple \n characters in xml file when using GTEST_SKIP. 2020-03-26 mvoorsluys Only write ">\n" once when there is failure and skipped tests. 2020-03-26 mvoorsluys Output skipped information in the xml file. 2020-02-06 59134746+aribibek fix a link to documentation 2020-01-17 hgsilverman Fix always false condition and clean function body Roll third_party/re2/ 787495f0b..aecba1111 (1 commit) https://github.com/google/re2/compare/787495f0ba2e...aecba11114cf $ git log 787495f0b..aecba1111 --date=short --no-merges --format='%ad %ae %s' 2020-05-27 junyer Refuse to rewrite when MaxSubmatch() is too large. Roll third_party/spirv-headers/ ac638f181..11d7637e7 (7 commits) https://github.com/KhronosGroup/SPIRV-Headers/compare/ac638f181542...11d7637e7a43 $ git log ac638f181..11d7637e7 --date=short --no-merges --format='%ad %ae %s' 2020-06-01 dneto spir-v.xml: Use plain ASCII quotes in comment 2020-05-29 cepheus Rebuild headers against the previous grammar commit. 2020-05-29 dmitry.sidorov Apply suggestions 2020-04-05 dmitry.sidorov Add Intel specific definitions from KhronosGroup/SPIRV-LLVM-Translator 2020-05-29 cepheus Header build from previous grammar update. 2020-05-25 michael.kinsner Propose bit allocation mechanism for the FP Fast Math Mode bitfield, following from the mechanism previously added for the loop control bitfield. 2020-04-05 dmitry.sidorov Add SPV_INTEL_function_pointers preview extension Roll third_party/spirv-tools/ 9cb2571a1..f050cca7e (7 commits) https://github.com/KhronosGroup/SPIRV-Tools/compare/9cb2571a184c...f050cca7ec47 $ git log 9cb2571a1..f050cca7e --date=short --no-merges --format='%ad %ae %s' 2020-05-29 andreperezmaselco.developer spirv-fuzz: Add push id through variable transformation (#3359) 2020-05-27 rharrison Rolling 4 dependencies (#3380) 2020-05-27 stevenperron Start SPIRV-Tools v2020.4 2020-05-27 stevenperron Finalize SPIRV-Tools v2020.3 2020-05-27 stevenperron Update CHANGES 2020-05-26 andreperezmaselco.developer spirv-fuzz: Support bit width argument for int and float types (#3378) 2020-05-26 andreperezmaselco.developer Fix function use (#3372) Created with: roll-dep third_party/effcee third_party/glslang third_party/googletest third_party/re2 third_party/spirv-cross third_party/spirv-headers third_party/spirv-tools
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, andlibshaderc
, a library API for accessing glslc
functionality.spvc
, a command line wrapper around the SPIR-V to GLSL/HLSL/MSL compiler SPIRV-Cross, andlibshaderc_spvc
, a library API for accessing spvc
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:
#include
supportspvc
wraps around core functionality in spirv-cross and SPIRV-Tools. spirv
and its library aims to provide:
Note: spvc
and its library are WIP and optional artifacts that are by default disabled in the build. How to enabled is detailed below.
Note: These binaries are just the artifacts of the builders and have not undergone any QA, thus they should be considered unsupported.
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 r18b.
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.
android_test/
: a small Android application to verify compilationcmake/
: CMake utility functions and configuration for Shadercexamples/
: Example programsglslc/
: an executable to compile GLSL to SPIR-Vlibshaderc/
: a library for compiling shader strings into SPIR-Vlibshaderc_util/
: a utility library used by multiple shaderc componentsthird_party/
: third party open source packages; see belowutils/
: utility scripts for ShadercShaderc depends on glslang, the Khronos reference compiler for GLSL.
Shaderc depends on SPIRV-Tools for assembling, disassembling, and transforming SPIR-V binaries.
Shaderc depends on the Google Test testing framework.
In the following sections, $SOURCE_DIR
is the directory you intend to clone Shaderc into.
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.)
git clone https://github.com/google/shaderc $SOURCE_DIR cd $SOURCE_DIR ./utils/git-sync-deps cd $SOURCE_DIR/
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.
Ensure you have the requisite tools -- see the tools subsection below.
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: (Skip building threaded unit tests due to Googletest bug 606)
cd $BUILD_DIR cmake -GNinja -DCMAKE_BUILD_TYPE={Debug|Release|RelWithDebInfo} $SOURCE_DIR \ -DCMAKE_TOOLCHAIN_FILE=$SOURCE_DIR/cmake/linux-mingw-toolchain.cmake \ -Dgtest_disable_pthreads=ON 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.
For building, testing, and profiling Shaderc, the following tools should be installed regardless of your OS:
On Linux, the following tools should be installed:
gcov
: for testing code coverage, provided by the gcc
package on Ubuntu.lcov
: a graphical frontend for gcov
, provided by the lcov
package on Ubuntu.genhtml
: for creating reports in html format from lcov
output, provided by the lcov
package on Ubuntu.On Linux, if cross compiling to Windows:
mingw
: A GCC-based cross compiler targeting Windows so that generated executables use the Micrsoft C runtime libraries.On Windows, the following tools should be installed and available on your path:
diff
.Optionally, the following tools may be installed on any OS:
asciidoctor
: for generating documentation.pygments.rb
required by asciidoctor
for syntax highlighting.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
The value SHADERC_ENABLE_SPVC
in CMakeLists.txt
must be set to ON
to enable building spvc
.
This can be achieved by either editing the file in your checkout, or passing -DSHADERC_ENABLE_SPVC=ON
to cmake
to set the value.
We track bugs using GitHub -- click on the “Issues” button on the project's GitHub page.
On Linux, you can obtain test coverage as follows:
cd $BUILD_DIR cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DENABLE_CODE_COVERAGE=ON $SOURCE_DIR ninja ninja report-coverage
Then the coverage report can be found under the $BUILD_DIR/coverage-report
directory.
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.