John Kessenich
ad3663be1f
Add ES 300 built-ins trunc, round, roundEven, modf, isnan, isinf, floatBitsToInt, floatBitsToUint, intBitsToFloat, uintBitsToFloat, packSnorm2x16, unpackSnorm2x16, packUnorm2x16, unpackUnorm2x16, packHalf2x16, and unpackHalf2x16, and new form of min, max, clamp, and mix.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21063 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-04-07 20:04:12 +00:00
John Kessenich
4ba94413d3
Split out the unary-argument built-in function path from the addUnaryMath() path, allowing the return types to be treated correctly without any special casing. Also, implement the correct precision qualifier propagation rules for built-in functions mapped to operators.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21062 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-04-07 02:10:55 +00:00
John Kessenich
ebeeece6a7
Add uint type (big change). For both int/uint, add the operators >>, <<, &, |, and ^. Also added unsigned literals and uint precision support. Also fixed how int/uint literal underflow/overflow is handled.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21054 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-04-05 04:05:39 +00:00
John Kessenich
ae722a6230
CPP: Handle the "u" and "U" suffixes for uint literals, and correctly handle underflow/overflow of integer literals.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21033 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-04-03 18:42:43 +00:00
John Kessenich
7d58d655c2
Add a forward reference function call test.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20945 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-03-21 17:33:38 +00:00
John Kessenich
a067b588aa
Fix release build, it was missing the custom build steps.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20845 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-03-13 01:58:33 +00:00
John Kessenich
213c464c60
Add and use ability to tell the backend compiler what version/profile the source shader was.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20840 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-03-12 17:53:55 +00:00
John Kessenich
d7c120f16f
A few trivial things, including removing '/' as a command line option indicator so absolute paths work naturally.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20839 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-03-12 17:52:59 +00:00
John Kessenich
20169715df
Get a clean g++/gcc build. Runs and gets correct results on linux.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20820 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-03-09 19:50:19 +00:00
John Kessenich
cfd643e447
Another round of gcc/g++ fixes.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20819 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-03-08 23:14:42 +00:00
John Kessenich
37827023c4
Add warning-suppression flag. Combined with relaxed errors, so an enum can be used instead of many bools.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20818 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-03-08 19:26:11 +00:00
John Kessenich
4055816bc9
Add compilation mode flags for forward-compatible contexts and relaxed error checking. These initiate as arguments to ShCompile() and both default to being off.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20817 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-03-08 18:49:22 +00:00
John Kessenich
9500dff05e
Upgrade to MSVC 11. Fix pool_allocator a bit.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20811 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-03-08 06:51:50 +00:00
John Kessenich
53fb465729
Change infrastructure to support constant folding across built-in functions, as required by 1.2 semantics. Partially fleshed out with min/max and some trig functions. Still have to complete all operations.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20806 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-03-07 19:22:07 +00:00
John Kessenich
3f3e0ad3ad
Add unsigned ints to constUnions. (Unsigned int support is still partial throughout.)
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20790 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-03-07 01:02:02 +00:00
John Kessenich
3252b18590
Minor updates to tests.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20758 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-03-04 23:50:08 +00:00
John Kessenich
ca8899c9ae
Add productions/data for about 14 qualifiers (versions 1.2 through 4.3). Fixed some case issues for rect/array keywords.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20742 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-03-01 21:53:13 +00:00
John Kessenich
4b67103b02
Implement operator-based implicit type conversions.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20724 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-28 20:49:41 +00:00
John Kessenich
ef8ae2e345
Allow gl_FragColor and gl_FragData in non-forward-compatible contexts for non-ES versions 150 - 410. Also add deprecation message for attribute/varying for core profile.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20714 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-27 19:02:52 +00:00
John Kessenich
df807514b6
Skip dummy unused second component for 1D non-array shadows.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20704 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-26 19:48:48 +00:00
John Kessenich
b3338b307f
Fix checking-in of wrong test files.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20703 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-26 19:47:21 +00:00
John Kessenich
db6b9117a6
Implement modern (130 and above) texturing. About 250 functions for 3.0, over 500 for 4.3, created programmatically. Handles all 3.0 functions, almost all 4.3 functions.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20698 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-25 19:44:56 +00:00
John Kessenich
4774d5ca15
Rationalize original texture functions per stage.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20685 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-22 19:06:20 +00:00
John Kessenich
d7f9406f82
Rationalize locations of type string methods.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20684 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-22 18:43:31 +00:00
John Kessenich
6f045f3e72
Expose the sampler type from a TType, and add a way to rebuild just the sampler type name for messages/annotation.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20672 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-21 17:22:17 +00:00
John Kessenich
e141d5c99c
Replace flat 110 sampler type space with an orthogonalized 430 sampler type space. Invoke it for all the sampler types in the 4.3 grammar.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20652 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-21 02:18:42 +00:00
John Kessenich
e396a22632
Make legacy texture prototypes more concise, fix minor bugs needed to support it.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20650 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-20 20:10:07 +00:00
John Kessenich
1aec044854
Line up version 100 and 110 texture prototypes under correct versions.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20649 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-20 19:04:22 +00:00
John Kessenich
1f2a36bd6b
Add ES 300 matrix operations: outerProduct, determinant, inverse, and transpose, and missing ES 300 limit gl_MaxFragmentInputVectors.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20643 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-20 04:42:42 +00:00
John Kessenich
bd0747d6f0
Built-in symbol tables now lazily evaluated, and driven by per version, per profile input. Got all ES 100 and ES 300 built-in symbols correct.
...
This includes
- doing prescan of shader to know version/profile before parsing it
- putting precision qualifiers on built-in ES symbols
- getting most built-in state correct for core/compatibility/missing profile
- adding gl_VertexID and gl_InstanceID, among other ES 300 built-in symbols
- adding the ES 300 gl_Max/Min constants
- accepting shaders that contain nothing but whitespace without generating an error
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20627 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-17 06:01:50 +00:00
John Kessenich
fb5f7eadfa
Improve robustness for symbol downcasts by moving to a "getAs" infrastructure and doing more error checking.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20609 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-14 19:02:23 +00:00
John Kessenich
e25cd0447d
CPP: Fix stack of previous nested #if/#else/#endif for whether a #else had been seen, which was sometimes cleared and sometimes not, effected later nested #if/#else/#endif #else checks.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20573 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-13 17:18:30 +00:00
John Kessenich
aab251435b
Add bash script for running through all tests.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20552 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-12 18:26:15 +00:00
John Kessenich
71fca670f3
Allow GLSL construction of matrix from matrix, starting with version 120, and always for ES shaders.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20544 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-12 08:02:20 +00:00
John Kessenich
f792295e35
Classify more keywords as to what versions they are identifiers, reserved, or keywords.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20540 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-12 06:53:13 +00:00
John Kessenich
3e1fcf34c5
Pass 2 at building on linux: remove compile errors from the preprocessor.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20539 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-12 04:58:22 +00:00
John Kessenich
54d8cda95e
Pass 1 at building on linux: remove compile errors from machine independent.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20536 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-11 22:36:01 +00:00
John Kessenich
dadf945fd7
Simultaneously fix only known memory leak and take the next step in supporting arrays of arrays. Improved several minor things along the way.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20514 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-11 00:54:44 +00:00
John Kessenich
6968b823ef
Add gl_PointCoord.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20510 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-08 22:54:14 +00:00
John Kessenich
38c507e75a
Make the default version be 100.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20509 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-08 18:56:56 +00:00
John Kessenich
46eaf4939e
Support multiple default versions, to enable ES vs. desktop contexts, for shaders missing a #version statement.
...
This also moved some parseContext code from the flex file to the proper C++ file.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20501 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-06 23:06:52 +00:00
John Kessenich
c435c71d87
Update copyrights.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20490 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-06 19:46:32 +00:00
John Kessenich
85e0e02f6f
Fix a preprocessor defect, where nested dead #if-#endif had nesting depth off by one level, turning what should be dead code into live code.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20461 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-06 02:23:47 +00:00
John Kessenich
464f6d9ff1
Add some CPP tests.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20457 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-06 00:14:16 +00:00
John Kessenich
f0fdc53e2a
Implement non-square matrices, and make a few type improvements. Cleaned up a few old issues. Added two tests.
...
Details
- added all the new non-square types
- separated concepts of matrix size and vector size
- removed VS 6.0 comments/workarounds
- removed obsolete concept of matrix fields
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20436 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-02-04 23:54:58 +00:00
John Kessenich
1c809955ba
Add ability to treat keywords as identifiers in versions that had not yet reserved the keyword.
...
Used this for precision keywords and double matrix keywords.
Also added a few missing reserved words.
Also removed redundant "syntax error" when there is a parse error.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20423 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-01-31 22:55:53 +00:00
John Kessenich
59ddbafb62
Have non-ES profiles always use EpqNone (no precision qualifier) rather than using highp. This keeps precision qualifiers out of error messages, IL dumps, etc., and avoids the precision propagation algorithm.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20364 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-01-29 17:24:14 +00:00
John Kessenich
e406f1c71c
Put in basic propagation algorithm for precision qualifiers. Some corner cases are document as TODO.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20360 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-01-28 23:52:49 +00:00
John Kessenich
cc2f8022d4
Hard code to ES profile for #version 100.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20334 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-01-28 18:28:28 +00:00
John Kessenich
868933d668
Add precision.frag test.
...
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20333 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-01-28 17:40:21 +00:00