commit | cd3adb0967cf2cf1e96c62908bd53eee225bd537 | [log] [tgz] |
---|---|---|
author | Andrew Woloszyn <awoloszyn@google.com> | Tue Jul 28 15:24:47 2015 -0400 |
committer | Lei Zhang <antiagainst@google.com> | Thu Aug 06 10:12:55 2015 -0400 |
tree | df15a2d8e81126eab26885638883ec0920a7baef | |
parent | 3cfc91a2523a61cbfcdb99a15182b05ad6a3c760 [diff] |
Cleaned up libshaderc a bit. We were converting char* data a std::vector<uint32_t> for the sole purpose of converting it back to char* data. Switched the std::vector into a std::string that can hold the bytes.
A collection of tools, libraries and tests for shader compilation.
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.
glslc/
: 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 belowShaderc depends on a fork of the Khronos reference GLSL compiler glslang. Shaderc also depends on the testing framework Google Mock.
In the following sections, $SOURCE_DIR
is the directory you intend to clone Shaderc into.
Check out the source code:
git clone https://github.com/google/shaderc $SOURCE_DIR cd $SOURCE_DIR/third_party svn checkout http://googlemock.googlecode.com/svn/tags/release-1.7.0
gmock-1.7.0 git clone https://github.com/google/glslang glslang 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}
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.
For building, testing, and profiling shaderc, the following tools should be installed regardless of your OS:
On Linux, the following tools should be installed:
gcc
package on Ubuntu.lcov
package on Ubuntu.lcov
package on Ubuntu.On Windows, the following tools should be installed and available on your path.
Optionally, the following tools may be installed on any OS:
We track bugs using GitHub -- click on the “Issues” button on [github.com/google/shaderc].
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.