Add missing `.cfg` files for GN presubmit.
Add missing `recursedeps` in the `DEPS` file.
Call `./update_glslang_sources.py` before attempting to build.
Add more GN spew to the `.gitignore` file.
This allows glslang to be build standalone using the gn build system.
To build with gn:
```
gclient sync --gclientfile=standalone.gclient
gn gen out/default
cd out/default
ninja
```
`.vscode/` ignores Visual Studio Code user config files
`bazel-*` ignores bazel build system symlinks.
`out/` ignores the default output directory for Visual Studio generated files.
Also added known-good mechanism to fetch latest validated spirv-tools.
Also added -Od and -Os to disable optimizer and optimize for size.
Fetching spirv-tools is optional for both glsl and hlsl. Legalization
of hlsl is done by default if spirv-opt is present at cmake time.
Optimization for glsl is currently done through the option -Os.
Legalization testing is currently only done on four existing shaders.
A separate baseLegalResults directory holds those results. All previous
testing is done with the optimizer disabled.
- Add new queries: TProgram::getUniformTType and getUniformBlockTType,
which return a const TType*, or nullptr on a bad index. These are valid for
any source language.
- Interface name for HLSL cbuffers is taken from the (only) available declaration name,
whereas before it was always an empty string, which caused some troubles with reflection
mapping them all to the same index slot. This also makes it appear in the SPIR-V binary
instead of an empty string.
- Print the binding as part of the reflection textual dump.
- TType::clone becomes const. Needed to call it from a const method, and anyway it doesn't
change the object it's called on.
- Because the TObjectReflection constructor is called with a TType *reference* (not pointer)
so that it's guaranteed to pass in a type, and the "badReflection" value should use a nullptr
there, that now has a dedicated static method to obtain the bad value. It uses a private
constructor, so external users can't create one with a nullptr type.
The existing test harness is a homemade shell script. All the tests
and the expected results are written in plain text files. The harness
just reads in a test, invoke the glslangValidator binary on it, and
compare the result with the golden file. All tests are kinda
integration tests.
This patch add Google Test as an external project, which provides a
new harness for reading shader source files, compile to SPIR-V, and
then compare with the expected output.