Update known-good spirv-tools.
[platform/upstream/glslang.git] / README.md
index 0059c2b..a6bddf8 100644 (file)
--- a/README.md
+++ b/README.md
@@ -9,20 +9,24 @@ glslang
 =======
 
 [![Build Status](https://travis-ci.org/KhronosGroup/glslang.svg?branch=master)](https://travis-ci.org/KhronosGroup/glslang)
+[![Build status](https://ci.appveyor.com/api/projects/status/q6fi9cb0qnhkla68/branch/master?svg=true)](https://ci.appveyor.com/project/Khronoswebmaster/glslang/branch/master)
 
 An OpenGL and OpenGL ES shader front end and validator.
 
-There are two components:
+There are several components:
 
-1. A front-end library for programmatic parsing of GLSL/ESSL into an AST.
+1. A GLSL/ESSL front-end for reference validation and translation of GLSL/ESSL into an AST.
 
-2. A standalone wrapper, `glslangValidator`, that can be used as a shader
-   validation tool.
+2. An HLSL front-end for translation of a broad generic HLL into the AST. See [issue 362](https://github.com/KhronosGroup/glslang/issues/362) and [issue 701](https://github.com/KhronosGroup/glslang/issues/701) for current status.
+
+3. A SPIR-V back end for translating the AST to SPIR-V.
+
+4. A standalone wrapper, `glslangValidator`, that can be used as a command-line tool for the above.
 
 How to add a feature protected by a version/extension/stage/profile:  See the
 comment in `glslang/MachineIndependent/Versions.cpp`.
 
-Things left to do:  See `Todo.txt`
+Tasks waiting to be done are documented as GitHub issues.
 
 Execution of Standalone Wrapper
 -------------------------------
@@ -45,47 +49,86 @@ There is also a non-shader extension
 Building
 --------
 
+Instead of building manually, you can also download the binaries for your
+platform directly from the [master-tot release][master-tot-release] on GitHub.
+Those binaries are automatically uploaded by the buildbots after successful
+testing and they always reflect the current top of the tree of the master
+branch.
+
 ### Dependencies
 
+* A C++11 compiler
 * [CMake][cmake]: for generating compilation targets.
-* [bison][bison]: _optional_, for regenerating grammar (if changes).
+* make: _Linux_, ninja is an alternative, if configured.
+* [Python 2.7][python]: for executing SPIRV-Tools scripts. (Optional if not using SPIRV-Tools.)
+* [bison][bison]: _optional_, but needed when changing the grammar (glslang.y).
+* [googletest][googletest]: _optional_, but should use if making any changes to glslang.
 
 ### Build steps
 
-1) Check out external projects:
+The following steps assume a Bash shell. On Windows, that could be the Git Bash
+shell or some other shell of your choosing.
+
+#### 1) Check-Out this project 
+
+```bash
+cd <parent of where you want glslang to be>
+git clone https://github.com/KhronosGroup/glslang.git
+```
+
+#### 2) Check-Out External Projects
 
 ```bash
+cd <the directory glslang was cloned to, "External" will be a subdirectory>
 git clone https://github.com/google/googletest.git External/googletest
 ```
 
-2) Configure. Assume the source directory is `$SOURCE_DIR` and
-the build directory is `$BUILD_DIR`:
+If you wish to assure that SPIR-V generated from HLSL is legal for Vulkan,
+or wish to invoke -Os to reduce SPIR-V size from HLSL or GLSL, install
+spirv-tools with this:
 
 ```bash
+./update_glslang_sources.py
+```
+
+#### 3) Configure
+
+Assume the source directory is `$SOURCE_DIR` and the build directory is
+`$BUILD_DIR`. First ensure the build directory exists, then navigate to it:
+
+```bash
+mkdir -p $BUILD_DIR
 cd $BUILD_DIR
+```
 
-# for building on Linux (assuming using the Ninja generator):
-cmake -GNinja -DCMAKE_BUILD_TYPE={Debug|Release|RelWithDebInfo} \
-      -DCMAKE_INSTALL_PREFIX=`pwd`/install $SOURCE_DIR
+For building on Linux:
 
-# for building on Windows:
-cmake $SOURCE_DIR -DCMAKE_INSTALL_PREFIX=`pwd`/install
+```bash
+cmake -DCMAKE_BUILD_TYPE={Debug|Release|RelWithDebInfo} \
+      -DCMAKE_INSTALL_PREFIX="$(pwd)/install" $SOURCE_DIR
+```
+
+For building on Windows:
 
+```bash
+cmake $SOURCE_DIR -DCMAKE_INSTALL_PREFIX="$(pwd)/install"
 # The CMAKE_INSTALL_PREFIX part is for testing (explained later).
 ```
 
-3) Build and install.
+The CMake GUI also works for Windows (version 3.4.1 tested).
+
+#### 4) Build and Install
 
 ```bash
 # for Linux:
-ninja install
+make -j4 install
 
 # for Windows:
 cmake --build . --config {Release|Debug|MinSizeRel|RelWithDebInfo} \
       --target install
 ```
 
-If using MSVC, after running CMake to configure, you may need to use the
+If using MSVC, after running CMake to configure, use the
 Configuration Manager to check the `INSTALL` project.
 
 ### If you need to change the GLSL grammar
@@ -167,15 +210,11 @@ For more information, please check `gtests/` directory's
 
 For the `runtests` script, it will generate current results in the
 `localResults/` directory and `diff` them against the `baseResults/`.
-The integration tests to run via the `runtests` script is registered
-via various `Test/test-*` text files and `Test/testlist`.
 When you want to update the tracked test results, they need to be
 copied from `localResults/` to `baseResults/`.  This can be done by
 the `bump` shell script.
 
-The list of files tested comes from `testlist`, and lists input shaders
-in this directory, which must all be public for this to work.  However,
-you can add your own private list of tests, not tracked here, by using
+You can add your own private list of tests, not tracked publicly, by using
 `localtestlist` to list non-tracked tests.  This is automatically read
 by `runtests` and included in the `diff` and `bump` process.
 
@@ -282,6 +321,8 @@ Basic Internal Operation
 
 
 [cmake]: https://cmake.org/
+[python]: https://www.python.org/
 [bison]: https://www.gnu.org/software/bison/
 [googletest]: https://github.com/google/googletest
 [bison-gnu-win32]: http://gnuwin32.sourceforge.net/packages/bison.htm
+[master-tot-release]: https://github.com/KhronosGroup/glslang/releases/tag/master-tot