Commit Graph

221 Commits

Author SHA1 Message Date
John Kessenich
5f753e0222 Full thread safety working:
- don't use [] for map lookups, it can modify the map
 - copy up built-in symbols out of shared symbol table levels before modifying them
 - enforce shallow vs. deep TType copies
 - combine maxArraySize with the array dimensions vector, encapsulate
 - remove chaining of array types


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22953 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-09-08 21:04:46 +00:00
John Kessenich
38f3b890de Ensure the shared symbol table levels are read-only to make multi-threading safe. Also removed inadvertent extra copies of the symbol table shared across all stages.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22939 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-09-06 19:52:57 +00:00
John Kessenich
69f4b517c2 Add link validation infrastructure for multiple compilation units per stage. Includes a new, straightforward, C++ interface to the front end.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22927 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-09-04 21:19:27 +00:00
John Kessenich
2f1eb37d82 Some rationalization of TIntermediate (to own it's own tree root) and TParseHelper for better encapsulation. Needed by some upcoming intra-stage link validation.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22914 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-09-03 22:57:27 +00:00
John Kessenich
807b8e3b82 Remove TIntermediate's dependency on infoSink, simplify folding of constant aggregates, and infoSink use in constant folding.
Added a few deep aggregate constant folding testing cases.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22912 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-09-03 22:14:59 +00:00
John Kessenich
fca7534044 Restore TDebugOptions, as code consuming this interface is still using it, even though the front-end proper no longer uses it.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22910 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-09-03 15:16:03 +00:00
John Kessenich
94a81fbd31 Option rationalization and minor clean up.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22907 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-31 02:41:30 +00:00
John Kessenich
8700e9e6d1 Add more constant folding cases for min, max, step, smoothstep, mix, clamp, atan, and pow.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22903 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-30 00:45:57 +00:00
John Kessenich
b603f918a4 Put all glslang internals (but not the external interface) into the glslang namespace.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22882 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-29 00:39:25 +00:00
John Kessenich
23bdb29eac Move the complex pieces of C++ code from glslang.y to ParseHelper.cpp. Updated some tests.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22846 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-27 05:57:15 +00:00
John Kessenich
d46b31fdc5 Give new scopes to non-compound (simple) if-then-else substatements, correcting scoping for declarations they contain.
Also, updated several tests and the Todo list.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22845 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-27 03:59:04 +00:00
John Kessenich
3af0d53dac Remove unnecessary TString constructors.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22844 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-27 03:43:13 +00:00
John Kessenich
a5ea9c63f7 Dynamically allocate symbol table containers, so timing of clean up can be more easily controlled WRT memory pool cleanup.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22681 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-13 00:58:49 +00:00
John Kessenich
99a0576225 Share built-in symbols common to all stages for desktop (but still per profile per version).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22662 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-09 20:31:43 +00:00
John Kessenich
c027579631 Put in infrastructure for tessellation, geometry, and compute stages, and partially flesh out with built-in functions.
Added the built-in functions EmitVertex(), EndPrimitive(), barrier(), memoryBarrier(), memoryBarrierAtomicCounter(), memoryBarrierBuffer(), memoryBarrierImage(), memoryBarrierShared(), and groupMemoryBarrier().

Have not added any new built-in variables.

Also changed the linear performance relateToOperator() to a high-performance version.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22659 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-09 17:14:49 +00:00
John Kessenich
317f1af217 Update Linux binaries for name-mangling bug fix
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22654 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-08 16:26:36 +00:00
John Kessenich
252b619066 Remove a mangled-name cache in the type that was sometimes stale.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22653 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-08 16:22:54 +00:00
John Kessenich
1b42f2a33d Add parse-time constant folding for isinf() and isnan().
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22621 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-06 20:22:51 +00:00
John Kessenich
af262433ab Update Linux binaries
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22605 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-05 17:11:37 +00:00
John Kessenich
acc55c2724 Update the Windows binary.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22604 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-05 17:09:24 +00:00
John Kessenich
8d2fe45334 Linux abs() needs to be fabs(); a few other minor Linux tweaks.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22603 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-05 16:36:49 +00:00
John Kessenich
4586dbdc1b Track expected test results and add more README information.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22602 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-05 15:52:03 +00:00
John Kessenich
41a5918eaa Allow unsigned int in the "location = " grammar, and generally improve recognition of numeric literals to be up to spec.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22597 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-04 23:51:37 +00:00
John Kessenich
161d482312 Add windows executable.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22595 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-03 00:27:08 +00:00
John Kessenich
b849c1de5c Add Linux executables
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22594 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-03 00:16:49 +00:00
John Kessenich
54f6e5661d Set up infrastructure for installing an executable. Changes the standalone name to glslangValidator.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22593 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-03 00:04:10 +00:00
John Kessenich
53f3cc977d Fix bison file naming issues from upgrading to version 2.7 of bison.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22578 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-01 18:04:50 +00:00
John Kessenich
ee6a9c8ba8 Make previous check in compile correctly on linux.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22568 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-07-31 23:19:17 +00:00
John Kessenich
2b07c7e70a Improve multi-threading and move Standalone to a multi-threading model (currently off though).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22565 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-07-31 18:44:13 +00:00
John Kessenich
b40a488e89 Update index.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22513 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-07-22 22:31:08 +00:00
John Kessenich
d7c0c3f49e Push index page now that SVN access is setup.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22512 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-07-22 22:29:42 +00:00
John Kessenich
c4cc787e71 Put on hold pending configuring glslang for public access.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22491 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-07-22 07:53:37 +00:00
John Kessenich
e2c091bdd6 Link glslang project into site nav.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22487 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-07-22 07:40:27 +00:00
John Kessenich
fb4a0b60bf Fix warning in release build. Update to-do list.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22315 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-07-09 23:57:13 +00:00
John Kessenich
d9d5f93da8 Tie missing default-precision error checks to EShMsgRelaxedErrors.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22304 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-07-09 17:23:39 +00:00
John Kessenich
e0ab8db923 Final linux tweak.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22294 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-07-08 21:50:31 +00:00
John Kessenich
3a05b78826 A few linux improvements/fixes for the previous check in.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22292 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-07-08 20:51:29 +00:00
John Kessenich
7213324259 Reframe the preprocessor as a C++ class, with instances, removing all C code, removing all global variables. Upgrade bison version to pass a parse context on through to the preprocessor. All the basic things to make something thread safe.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22291 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-07-08 19:39:16 +00:00
John Kessenich
5f1a0b7998 Eliminate flex as the GLSL lexical analyzer, going from two nested lexical analyzers down to one, leaving just the preprocessor's lexical analysis. A new layer replaces it, to translate from the preprocessor's view of tokenization to glslang's view of tokenization.
Also:
 - change source locations from an int to TSourceLoc (shader number, line number) throughout
 - various improvements to the preprocessor


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22277 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-07-06 19:54:21 +00:00
John Kessenich
73ed17a87b Rationalize naming/access to current thread-local-storage scheme. However, the preprocessor tokenizer is not thread-safe, so this may all change.
Also adding missing test.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22249 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-07-02 20:18:59 +00:00
John Kessenich
1fde51d3fb 1) Don't propagate precision of built-in function arguments to return type when return type is bool (e.g., isnan).
2) Check an additional path for missing default precision qualification, except allow built-in declarations to pass the check.  

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22241 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-07-01 17:56:24 +00:00
John Kessenich
6c0928d924 Fix bug dropping some qualifiers when merging with block member default qualification.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22240 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-07-01 04:54:28 +00:00
John Kessenich
69c3d8c1a0 Use the default of "smooth" for interpolation qualification for vertex outs and fragment ins (rather than all fragment IO).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22222 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-28 05:32:15 +00:00
John Kessenich
554c854143 Fix preprocessor memory leak.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22195 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-26 23:41:30 +00:00
John Kessenich
db4cd54dac Handle bad input file.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22194 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-26 22:42:55 +00:00
John Kessenich
e369bfccfe Semantic checks for .length(), switch/case/default, and multidimensional arrays.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22175 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-26 05:54:40 +00:00
John Kessenich
ef84d10e4c Add semantic check for precision qualifier on wrong kind of type. Added a few more tests.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22170 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-25 21:53:59 +00:00
John Kessenich
d3f85891a7 Support line-continuation (backslash before newline) for tokens and one-line comments in the preprocessor.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22168 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-25 21:09:47 +00:00
John Kessenich
e5f80b8054 Remove the -a option, it doesn't belong here.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22166 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-25 18:31:47 +00:00
John Kessenich
41cf6b540b Add scanner that can find '#version' across an array of non-null terminated, length-based, strings. Handle the ES error where #version is not the first thing found, while still supporting desktop behavior, and more generally support length-based multiple strings for a single shader.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22165 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-25 18:10:05 +00:00