tag | f066d28944859bb9eac1b8cb2566950d619da472 | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Mon Jul 25 15:49:31 2016 -0700 |
object | 74e923f8b61f67c45eac3b5835a24974308a17d6 |
NDK Release 13 Beta 1 (3057941)
commit | 74e923f8b61f67c45eac3b5835a24974308a17d6 | [log] [tgz] |
---|---|---|
author | David Neto <dneto@google.com> | Mon Jun 20 10:40:12 2016 -0400 |
committer | David Neto <dneto@google.com> | Mon Jun 20 10:40:12 2016 -0400 |
tree | a3e78163149074ccffbd1db9214344e6e1e62f72 | |
parent | 08f8e49598711f107422b6027c26d6957a241e1d [diff] | |
parent | 4a3e55102aff26faffbc2bb2d836d83e9bbdb561 [diff] |
Merge remote-tracking branch 'aosp/upstream-master' into update-shaderc-sources Adds the following: 4a3e551 Fix tests for catching up with the master of glslang. 0b7140e Add Adam Chainz (adam@adamj.eu) into CONTRIBUTORS. af6a8a7 Use .io readthedocs links for nosetests. bdae28e Android: Use grammar files from SPIRV-Headers repo 1a9d48f SPIRV-Tools now depends on external SPIRV-Headers repo 43620d2 SPIRV-Tools now requires SPIRV-Headers. 88a7261 SPIRV-Tools validator sources have moved. d0c93d2 Glslang has a new source file. 8d8aecd Fix parsing of version from CHANGES file: -dev is optional ebeff38 MinGW linking C executables: statically link libgcc bc1b677 Print <yyyy>-<index> info for --version option b3cfde4 -mfmt=bin/c/num to select binary output format 5e1f49e README links to glslc manual 52ecd9b Register the new file in glslang into Android.mk. e050f37 Register new files appearing in glslang into Android.mk. cd8793c Fix add_copyright.py and add license to android_test/test.cpp. 235eb39 Add rules to create build-version.inc on Android. 79c9e9d Update Android.mk for new SPIR-V Tools source file e1206a1 Update glslc manual about assembling support. 9a35bcf Add new dependencies for assembling support into Android.mk. 215a0b6 Add support for assembly files in glslc. cf4c497 Add assembling support into shaderc C and C++ interface. a0510ce Move SPIRV-Tools wrapper functions into their own files. c2dcb79 Compilation fails for null input file name string 7308a2c Add comment for one CMake custom target. f9651b7 Add .inc grammar generation to Android.mk.
A collection of tools, libraries and tests for shader compilation. At the moment it includes:
glslc
, a command line compiler for GLSL to SPIR-V, andlibshaderc
a library API for doing the same.Shaderc is experimental, and subject to significant incompatible changes.
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. Sometimes a change updates both Shaderc and glslang. In that case the glslang change will appear in google/glslang before it appears upstream in KhronosGroup/glslang. We intend to upstream all changes to glslang. We maintain the separate copy only to stage those changes for review, and to provide something for Shaderc to build against in the meantime. Please see DEVELOPMENT.howto.md for more details.
Shaderc depends on SPIRV-Tools for assembling and disassembling 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.
git clone https://github.com/google/shaderc $SOURCE_DIR cd $SOURCE_DIR/third_party git clone https://github.com/google/googletest.git git clone https://github.com/google/glslang.git git clone https://github.com/KhronosGroup/SPIRV-Tools.git spirv-tools git clone https://github.com/KhronosGroup/SPIRV-Headers.git spirv-tools/external/spirv-headers cd $SOURCE_DIR/
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 documenation.pygments.rb
required by asciidoctor
for syntax highlighting.nosetests
: for testing the Python code.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
interally, 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
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.