4231 Commits

Author SHA1 Message Date
John Kessenich
11fa4d0d56
Merge pull request #2348 from ben-clayton/thread-local
Simplify PoolAlloc by using `thread_local`
2020-07-22 11:47:06 +07:00
John Kessenich
1c42d4ee7b
Merge pull request #2345 from mbechard/master
also search global sequences for live variables
2020-07-22 11:15:24 +07:00
johnkslang
c63502cf67 SPV: Update to the latest SPIR-V headers. 2020-07-21 21:05:25 -06:00
Ben Clayton
abf92c80b9 Deprecate InitializeDll functions
These were only used for TThreadPool, which now uses `thread_local`.
2020-07-21 09:40:34 +01:00
Ben Clayton
a3845240ae Simplify PoolAlloc with use of thread_local.
glslang is using C++ 11, which has first class support for variables of the `thread_local` storage class.

By dropping the use of the `OS_[GS]etTLSValue`, we can simplify the logic, and have it support a thread-local default allocator if none is provided.

Issue: #2346
2020-07-21 09:40:34 +01:00
John Kessenich
b99a6a7273
Merge pull request #2352 from ben-clayton/vs2015
Finalize glslang 10.15.3847, start glslang 11, drop support for VS2013
2020-07-21 10:55:12 +07:00
Malcolm Bechard
5727fb313e also search global variables assignment for live variables
when traversing the AST to find live UBOs etc, also traverse
references to global module-level variables, incase they are
being filled in from UBOs etc.
2020-07-20 18:43:00 -04:00
Ben Clayton
c487d0feaa Drop support for VS2013
This was scheduled for today - 20th July 2020.

Updates Appveyor configs to use VS2015 instead.
2020-07-20 18:50:06 +01:00
Ben Clayton
70860c284e Start glslang 11.0.0 2020-07-20 16:39:42 +01:00
Ben Clayton
6c7beeafa7 Finalize glslang 10.15.3847 2020-07-20 16:39:42 +01:00
Ben Clayton
4268914774 build_info: Fix parsing of versions with no flavor 2020-07-20 16:39:42 +01:00
John Kessenich
9eef54b251
Merge pull request #2351 from ben-clayton/license-checker-cfg
Update license-checker.cfg with simplified rules
2020-07-18 16:30:04 +07:00
Ben Clayton
047425a4db Update license-checker.cfg with simplified rules
`license-checker` has been updated to support `**` wildcards simplifying the ruless, and multiple license configs.

Add a new config for the bison generated files to ensure their licenses don't change.
2020-07-17 20:08:05 +01:00
John Kessenich
ae08b5b74c
Merge pull request #2350 from ben-clayton/update-license-checker-rules
Add new rules for update of license-checker
2020-07-17 20:33:14 +07:00
Ben Clayton
5a7a7dbd1e Add new rules for update of license-checker
`license-checker` will be updated to support `**` based wildcards. As part of this, `license-checker` will now traverse into subdirectories that would previously be excluded when the parent directory is excluded.

This change adds new rules that work with both the old version and new, to ease migration.
2020-07-17 11:59:26 +01:00
John Kessenich
f3cb189697
Merge pull request #2349 from KhronosGroup/return-precision
GLSL/SPV: Propagaet precision qualifier from function to return value.
2020-07-16 14:36:51 +07:00
John Kessenich
3d2391fb25 GLSL/SPV: Propagaet precision qualifier from function to return value.
When a return value's type has no precision qualification (e.g., the return
expression is formed from a constructor), and the formal function return type
has a precision qualification, back propagate that from the return type to the
type of the return value's expression.
2020-07-15 23:38:47 -06:00
John Kessenich
4f72970ed3
Merge pull request #2347 from ben-clayton/runtests
runtests: Check error codes, set LD_LIBRARY_PATH
2020-07-16 09:45:50 +07:00
Ben Clayton
f429b72298 runtests: Check error codes, set LD_LIBRARY_PATH
`glslangValidator` will only return [the codes 0..6](b481744aea/StandAlone/StandAlone.cpp (L117-L125)). Fail the test if anything else is returned (like due to the exe crashing).

Also set `LD_LIBRARY_PATH` to contain the `lib` directory before calling glslang.
2020-07-15 11:59:44 +01:00
John Kessenich
b481744aea
Merge pull request #2335 from ben-clayton/kokoro-bazel-test-output
Kokoro: Print test output to stdout
2020-07-14 16:11:43 +07:00
John Kessenich
39b8de1e99
Merge pull request #2344 from ben-clayton/build_info-x
Give build_info.py the executable bit
2020-07-14 16:11:04 +07:00
Ben Clayton
89a5ee09d5 Give build_info.py the executable bit 2020-07-14 10:09:51 +01:00
John Kessenich
3ea2c8fc72
Merge pull request #2343 from KhronosGroup/fix-non-determinism
Fix recently found non-determinism with gl_WorldToObject3x4EXT.
2020-07-14 15:13:22 +07:00
John Kessenich
f80ef74c80 Fix recently found non-determinism with gl_WorldToObject3x4EXT. 2020-07-14 01:44:35 -06:00
John Kessenich
3aa4431460
Merge pull request #2339 from ben-clayton/cmake-project
CMake: Move project() to top of CMakeLists.txt
2020-07-14 14:12:15 +07:00
John Kessenich
7bedc52abb
Merge pull request #2341 from ben-clayton/bison-license
Add bison license to LICENSE.txt
2020-07-14 14:07:21 +07:00
John Kessenich
fe24a54808 Non-determinism: Remove test file that seems to trigger non-determinism.
This problem needs to be fixed, but in parallel, we need to see master
and any other changes to it passing all tests.

The removed test is ray-tracing centric, and may indicate non-determinism
in recent code added for that functionality.
2020-07-14 00:32:25 -06:00
Ben Clayton
14a2cfbc72 Add bison license to LICENSE.txt 2020-07-13 20:32:09 +01:00
Ben Clayton
6b20d83c41 CMake: Move project() to top of CMakeLists.txt
Also remove `NOTICE` from message() about PCHs - it seems to print this in the actual message, contrary to the documentation where it is used as a severity.
2020-07-13 19:14:02 +01:00
Ben Clayton
16ef2588ed Kokoro: Print test output to stdout 2020-07-13 16:20:06 +01:00
John Kessenich
f5add0b20d
Merge pull request #2337 from KhronosGroup/revert-ANGLE
Revert "Merge pull request #2330 from ShabbyX/optimize_for_angle"
2020-07-13 17:34:05 +07:00
John Kessenich
07211b42db Fix comma in licence checker. 2020-07-13 03:52:02 -06:00
John Kessenich
4f32f93d7e Revert "Merge pull request #2330 from ShabbyX/optimize_for_angle"
This reverts commit 1ee5d1c0bb683daea245e8329fd619940a35a5b4, reversing
changes made to 906d48a7e828701e25487c9cf34418ded831c814.
2020-07-13 03:39:08 -06:00
John Kessenich
5799f5befe Fix a couple lines that were too long, to retrigger bots. 2020-07-13 02:52:11 -06:00
John Kessenich
4e13c90944 Fix #2329: don't use invalid initializers. 2020-07-13 00:35:58 -06:00
John Kessenich
206886948a
Merge pull request #2334 from ben-clayton/license-checker-cfg
Add missing comma from license-checker.cfg
2020-07-12 22:43:35 +07:00
Ben Clayton
6788647d8e Add missing comma from license-checker.cfg
Fixes license checker presubmit.
2020-07-12 13:07:39 +01:00
John Kessenich
09ea6fa99a
Merge pull request #2333 from 1480c1/mingw-w64
Common: include standard headers before doing any defines
2020-07-12 17:05:59 +07:00
Christopher Degawa
8486b2e0db
Common: include standard headers before doing any defines
currently, due to

```c++
\#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) || defined MINGW_HAS_SECURE_API
    #include <basetsd.h>
    #ifndef snprintf
    #define snprintf sprintf_s
    #endif
    #define safe_vsprintf(buf,max,format,args) vsnprintf_s((buf), (max), (max), (format), (args))
```

defining `snprintf` to `sprintf_s` essentially unconditionally, this will break the
stdio.h+cstdio system header for mingw-w64 g++ in msys2 with shaderc
https://github.com/google/shaderc/issues/1065

an alternative change would be
https://raw.githubusercontent.com/shinchiro/mpv-winbuild-cmake/master/packages/glslang-0001-fix-gcc-10.1-error.patch
in which the `|| defined MINGW_HAS_SECURE_API` part is removed

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
2020-07-12 00:06:35 +00:00
John Kessenich
1ee5d1c0bb
Merge pull request #2330 from ShabbyX/optimize_for_angle
Optimize for angle
2020-07-12 00:32:52 +07:00
John Kessenich
906d48a7e8
Merge pull request #2332 from ben-clayton/fix-cmake-include
Fix CMake rules when nesting CMake projects
2020-07-10 21:54:37 +07:00
Ben Clayton
2270713d6a Fix CMake rules when nesting CMake projects
`${CMAKE_SOURCE_DIR}` points to the outer project root, not the current directory.

Fixes building of `glslang` when included into another CMake project.
2020-07-10 14:39:39 +01:00
John Kessenich
2041586674
Merge pull request #2331 from ben-clayton/fix-chromium
Attempt to fix chromium builds
2020-07-10 07:00:11 -06:00
Ben Clayton
360ba05949 Attempt to fix chromium builds
It would seem that `glslang_sources` has a private dependency on `glslang_build_info`, so `glslang_validator` cannot transitively `#include` the generated `glslang/build_info.h` header.

Add `glslang_build_info` as a direct dependency to `glslang_validator`.
Also remove the duplicate dependency on `glslang_build_info` in `glslang_sources_common`

Note: This is a speculative fix as I can build Chromium fine without these changes.
Not sure what's different between these configs.
2020-07-10 13:46:32 +01:00
John Kessenich
020397608e
Merge pull request #2277 from ben-clayton/build-info
Generate build information from CHANGES.md
2020-07-10 05:43:10 -06:00
Ben Clayton
fbe9a23baf Generate build information from CHANGES.md
This PR significantly reworks the way glslang is versioned.

Instead of committing changes to the `GLSLANG_MINOR_VERSION` define in
`glslang/Public/ShaderLang.h`, and using `make-revision` to generate
`GLSLANG_PATCH_LEVEL` in `glslang/Include/revision.h`, all version
information is now derived from the new `CHANGES.md` file.

`CHANGES.md` acts as the single source of truth for glslang version
information, along with a convenient place to put all release notes for
each notable change made.

`CHANGES.md` is parsed using the new `build_info.py` python script.
This script can read basic template files to produce new source files,
which it does to read the new `build_info.h.tmpl` to generate (at build
time) a glslang private header at
`<build-dir>/include/glslang/build_info.h`.
I've written generators for each of the CMake, Bazel, gn, and
`Android.mk` build scripts.

The new version code conforms to the Semantic Versioning 2.0 spec.

This new version is also used by the CMake rules to produce versioned
shared objects, including a major-versioned SONAME.

New APIs:
---------

* `glslang::GetVersion()` returns a `Version` struct with the version
  major, minor, patch and flavor.

Breaking API changes:
---------------------

* The public defines `GLSLANG_MINOR_VERSION` and `GLSLANG_PATCH_LEVEL`
  have been entirely removed.
* `glslang/Public/ShaderLang.h` and `glslang/Include/revision.h` have
  been deleted.
* Instead, `<build-dir>/include/glslang/build_info.h` is created in
  the build directory, and `<build-dir>/include` is a CMake `PUBLIC`
  (dependee-inherited) include directory for the glslang targets.
* `<build-dir>/include/glslang/build_info.h` contains the following
   new #defines:
   `GLSLANG_VERSION_MAJOR`, `GLSLANG_VERSION_MINOR`,
   `GLSLANG_VERSION_PATCH`, `GLSLANG_VERSION_FLAVOR`,
   `GLSLANG_VERSION_GREATER_THAN(major, minor, patch)`,
   `GLSLANG_VERSION_GREATER_OR_EQUAL_TO(major, minor, patch)`,
   `GLSLANG_VERSION_LESS_THAN(major, minor, patch)`,
   `GLSLANG_VERSION_LESS_OR_EQUAL_TO(major, minor, patch)`
*  The CMake install output directory contains a copy of
   `build_info.h` at: `include/glslang/build_info.h`
*  Python3 is now always required to build glslang (likely always
   required for transitive dependency builds).
2020-07-09 12:34:02 +01:00
John Kessenich
5aaa0c2bc8
Merge pull request #2327 from ben-clayton/fix-pch
Use CMake's builtin functionality for pre-compiled headers
2020-07-09 00:39:31 -06:00
Shahbaz Youssefi
59fb2d6361
Customize glslang.y to GLSLANG_ANGLE
glslang.y is specialized to remove what is not supported or won't be
supported by ANGLE.

This change shaves about 125KB off of ANGLE's binary size with minor
improvement to the cost of SetupBuiltinSymbolTable.

Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>
2020-07-08 16:01:42 -04:00
Shahbaz Youssefi
8c49d15fbf
Use GLSLANG_ANGLE to strip features to what ANGLE requires
This change strips a few features similar to GLSLANG_WEB but doesn't
remove every detail like the latter.  It also hardcodes profile/version
to core/450.

In particular, TBuiltIns::initialize is specialized to remove most of
what is not supported or won't be supported by ANGLE.  The result of
this function is parsed with TParseContext::parseShaderStrings which is
a performance bottleneck.

This change shaves about 300KB off of ANGLE's binary size and reduces
the cost of SetupBuiltinSymbolTable to nearly a sixth.

Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>
2020-07-08 15:33:20 -04:00
John Kessenich
29c9135d06
Merge pull request #2328 from zoddicus/fixBUILDgn
Make sure glslang_angle has a definition in BUILD.gn
2020-07-07 11:01:30 -06:00