Commit Graph

980 Commits

Author SHA1 Message Date
John Kessenich
6e62d92cfb Fix bug where an anonymous member of a built-in block containing another member with an implicitly-sized array caused two copies of the block to be referenced.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26633 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-05-14 02:38:14 +00:00
John Kessenich
bae44b74d4 Finish GL_ARB_shading_language_420pack: *ProgramTexelOffset built-in constants. Also, make comma operation not fold constants.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26602 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-05-11 01:07:31 +00:00
John Kessenich
0b9e112da6 420Pack: Implement length() on vectors and matrices. Also, tweak line-continuation semantics to understand the extension.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26601 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-05-10 22:24:50 +00:00
John Kessenich
d7dfe2c2b2 Prevent crash when bad shader redeclares built-in array names it is not supposed to redeclare.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26520 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-05-06 22:58:55 +00:00
John Kessenich
8a1a4a7a8b Implement implicit conversions on function return expressions to the function's type.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26501 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-05-06 06:02:01 +00:00
John Kessenich
2ea882fdae Change ERROR to WARNING to finish fixing bug 11904, comment 3: bug 11856 resolved to drop the ERROR regarding no statements after the last label in the switch.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26479 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-05-01 16:48:18 +00:00
John Kessenich
8d6ce1c227 Improve the 150.geom test.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26445 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-04-29 23:09:26 +00:00
John Kessenich
f000058fd9 Allow the pre-150 built-in redeclarations when using SSO: gl_Position, gl_PointSize, gl_ClipVertex, and gl_FogFragCoord.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26399 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-04-24 22:38:50 +00:00
John Kessenich
e96ee859a8 Establish desktop completeness through version 1.50. (gl_MaxVaryingFloats, implicit-cconversion safety, cube-sampler-array fix, add tests)
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26253 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-04-14 22:08:16 +00:00
John Kessenich
447c65c978 Two missing test file sources.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26230 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-04-14 16:14:30 +00:00
John Kessenich
263a134edd Correct the test results from the last check in.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26229 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-04-14 16:11:00 +00:00
John Kessenich
2bbd2a3be8 Add missing tests and test results.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26228 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-04-14 16:10:01 +00:00
John Kessenich
cf0206c341 Restore r26245 and all tests and test results since 4/1:
r26245: Remove "not yet complete" warning for versions 130 and 140, after tidying up a bit and adding tests.  Token pasting is the only known missing feature, and gives its own message now on use.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26226 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-04-14 15:46:40 +00:00
John Kessenich
f2d042a1fe Non-functional, infrastructure: Be more explicit about "implicit array sizes", improving the infrastructure for handling them. Also fix some output that was too big for its buffer.
There is more upcoming functionality for link-time sizing of implicitly-sized arrays that will use this.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26176 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-04-02 02:27:26 +00:00
John Kessenich
b4ef9e0d56 Track which extensions were enabled or required, in the intermediate representation, for reflection of the consumer.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26155 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-31 22:20:47 +00:00
John Kessenich
585982e32a Add getStage() and getIntermediate() methods for consumers. Also removed dead options and update test file.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26126 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-28 17:49:10 +00:00
John Kessenich
f5dd2f5c7c Expand implicit argument conversions to also include handling built-in function calls.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26080 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-26 03:17:31 +00:00
John Kessenich
71e01cbab9 Make switch statements have their own nested scope (bug 11904).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25949 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-17 22:48:25 +00:00
John Kessenich
c63759ef01 Additional test results for previous check in.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25913 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-16 23:18:34 +00:00
John Kessenich
75694fdacd Implement implicit conversions of function-call arguments (both in and out) as explicit conversions in the AST, through handleArgumentConversions().
Also
 - uniformly handle EvqConstReadOnly as an input argument in a function, with 
   isParamInput() and isParamOutput() queries in TQualifier.
 - provide a makeTemporary() in TQualifier, for erasing original qualification when making a temp
 - provide a makeInternalVariable() call to make a shader variable not seen in the shader source


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25912 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-16 23:03:07 +00:00
John Kessenich
71241d8221 Allow choice of DLL or static CRT libraries through CMake options.
Also, some trivial miscellaneous build-related changes.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25811 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-12 02:34:44 +00:00
John Kessenich
3ce1058dbe update Linux build for latest CMake changes from Windows
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25793 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-11 06:35:42 +00:00
John Kessenich
d18e2d8adc Add CMake support for Visual Studio and installation, with an expected "install" for CMAKE_INSTALL_PREFIX, and updated test scripts to consume the CMake installation.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25791 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-11 02:10:26 +00:00
John Kessenich
b35e9bfa21 Track things like "(3)" and "+3" as expressions, not literals.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25511 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-02-24 21:16:19 +00:00
John Kessenich
52c351442c Update rules for "GL_", "gl_", and "__" to match latest specification bug fixes.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25392 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-02-18 21:55:42 +00:00
John Kessenich
56876dcfe7 Fix missing semantic check: Disallow layout qualifiers when augmenting an already declared variable with a qualifier.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25351 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-02-13 19:14:33 +00:00
John Kessenich
782aa830b6 Correct which versions can support the extensions GL_ARB_separate_shader_objects and GL_ARB_shading_language_420pack. They'd only gone back to 150, rather than 130/140.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25314 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-02-12 05:15:49 +00:00
John Kessenich
4094630ca3 GL_ARB_enhanced_layouts, final. #extension tests, built-in constants, and bug fix for non-constant expression in layout(...=expr).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25220 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-02-03 16:28:23 +00:00
John Kessenich
ac1e188f3b GL_ARB_enhanced_layouts, part 6: Numerical side of uniform offset and align semantics. Included
- moving offset calculations for std140/std430 from reflection to linkValidate.cpp
 - applying the offset/align rules on top of std140/std430
 - removing caching the structure's number of components (and correcting that this is components, not size)


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25174 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-01-31 02:40:19 +00:00
John Kessenich
04b1c6ed4c GL_ARB_enhanced_layouts, part 5: uniform offset and align semantics. Numerical computations not yet done.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25092 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-01-28 21:13:59 +00:00
John Kessenich
e5fbec8a17 Support GL_ARB_texture_cube_map_array extension for desktop.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25025 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-01-26 22:22:54 +00:00
John Kessenich
c7776ec3fd GL_ARB_enhanced_layouts, part 4: Numerical side of xfb_*: offset computation, size computation, alias detection, paddings, overflow, implicit strides, gl_Max* checks, etc.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25014 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-01-26 01:37:13 +00:00
John Kessenich
44b807e1d0 GL_ARB_enhanced_layouts, part 3: Semantics for xfb_*: where they can go, inheritance, etc., but not yet the backing arithmetic for offsets and strides.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24916 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-01-21 04:43:23 +00:00
John Kessenich
4f9aebf659 update Makefile dependencies
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24738 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-01-10 21:25:05 +00:00
John Kessenich
68546c6ca4 GL_ARB_enhanced_layouts, part 2: Full implementation of location/component, plus the parsing for xfb* and align/offset (but not yet full semantics for align/offset).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24692 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-01-08 23:25:18 +00:00
John Kessenich
b76d6d6496 GL_ARB_enhanced_layouts, part 1: Track whether constants are literals, to enable version-specific checking of layout(... = literal) vs. layout(... = expression).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24675 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-01-07 18:14:48 +00:00
John Kessenich
5053a39578 Fix slight inconsistencies in which qualifiers are inherited into block members:
- don't inherit 'binding'
 - always set the member storage qualifier, not just when the shader explicitly set it
 - don't include in/out members as objects that are resized by geometry/primitive layout specifiers
As a side effect, this makes built-in redeclarations (like gl_ClipDistance) require in/out.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24674 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-01-07 17:44:41 +00:00
John Kessenich
7cbfdf4394 Minor infrastructure changes, to simplify an upcoming check in:
- print out block member types when printing a block (makes all test results change)
 - const versions of all intermediate.h type-identification methods
 - layoutSlotLocation -> layoutLocation

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24664 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-01-06 21:27:56 +00:00
John Kessenich
7054075804 Tests: add a few more test cases.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24635 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-31 23:02:24 +00:00
John Kessenich
99b0ffd468 Properly handle 'default' nested in flow control, as well as default/case outside switch statements.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24629 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-31 00:13:26 +00:00
John Kessenich
ddbe0befd7 Update windows binaries.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24628 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-30 20:44:49 +00:00
John Kessenich
bd306b89a4 fix g++ complaint and update binaries
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24627 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-30 20:40:03 +00:00
John Kessenich
fcb4ed054c Preprocessor: Rationalize, simplify, and correct the stack of input sources and their tokenization. This included
- consistently dealing with EOF and its effect on error recovery (bug 11444, #1)
 - turning a simulated OO hierarchy of function pointers and typecasting into a real C++ class hierarchy
 - correctly handling '\' everywhere, in all classes of tokens, as a layer before preprocessing itself
 - conditionally handling '\n' in macro expansion input, depending on whether it is in a macro expression or not
 - delete some unused "memory cleanup" code


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24626 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-30 20:34:28 +00:00
John Kessenich
08d182470b Add array sizing/checking/overlapping semantics for tessellation inputs.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24594 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-20 18:36:27 +00:00
John Kessenich
e8fe7b81d7 Allow tessellation shaders to work on versions back to 150. Also combined all the tessellation tests into a single run.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24569 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-18 18:47:12 +00:00
John Kessenich
7c908d2543 Additional semantic checking for tessellation shaders and related clean up:
- non-arrayed geometry inputs and tessellation-control outputs
 - include user blocks in i/o array resizing based on primitive type
 - things belonging only to 'in' or 'out' are verified only on 'in' or 'out'
 - invocation number changing
 - move shader-scoped qualifier checking into its class
 - remove an incidental union of two levels of the node hierarchy in the yacc stack
 - remove layout(location=) default tracking when setting on a variable


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24551 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-18 03:06:24 +00:00
John Kessenich
bd95819123 1) Allow '\' before a non-newline as a token in the preprocessor, and 2) localize line-continuation to just the pp scanner.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24530 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-16 23:58:15 +00:00
John Kessenich
27151efa71 Tessellation: Smaller changes: Take tessellation control output arrayness into account in location overlap testing, better error message for redeclaring a built-in with size to be unsized.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24522 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-13 19:26:54 +00:00
John Kessenich
f3e2a89452 Tessellation: Implicit array sizing and consistency checking of control-shader output arrays based on layout(vertices=...).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24518 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-13 18:38:43 +00:00
John Kessenich
116c30b6ed Tessellation: implement 'patch' semantics.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24486 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-12 01:25:37 +00:00
John Kessenich
3a4687d782 Add missing check that a function call is not using the same name as a variable hiding the function's name. Also, support version 110 separate name spaces for functions and variable names.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24480 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-11 22:38:19 +00:00
John Kessenich
623833fabc Tessellation partial implementation (not ready for use yet), including:
- the built-in constants
 - built-in variable declarations, some dependent on gl_MaxPatchVertices
 - layout qualifier for vertices (shared with geometry shader max_vertices)
 - layout qualifiers for vertex spacing, vertex order, point mode, and primitive type
 - link semantics for layout qualifiers

Still TBD:
 - patch qualifier and arrayed input handling
 - sizing of gl_out[]
 - additional semantic checking
 - supporting the extension on version 150

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24468 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-11 18:57:40 +00:00
John Kessenich
2d2f31625d Preprocessor: Implement skipping of macros that evaluate to nothing while evaluating expressions. They had been causing early termination of an expression's evaluation.
Also includes some unrelated updates of documentation.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24420 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-10 00:25:14 +00:00
John Kessenich
c719481d43 Flesh out 4.x block redeclaration semantics:
- hide non-redeclared anonymous members
 - array size limit checking
 - illegal member qualifiers
 - additional members


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24406 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-09 00:37:46 +00:00
John Kessenich
e1b2e39a56 Allow layout aliasing for desktop vertex inputs.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24400 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-07 00:28:07 +00:00
John Kessenich
5f15d4224a Desktop array size limit checking for gl_ClipDistance[] and gl_TexCoord[].
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24397 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-06 23:57:42 +00:00
John Kessenich
64bcb105c9 Made '\' at end of C++ comments be a warning. It is line continuation for some versions, but not others.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24396 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-06 21:45:15 +00:00
John Kessenich
7fc3669195 Preprocessor: Add short-circuit logic so ES errors are not given on undefined variables that are short circuited in && and || preprocessing expressions.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24390 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-06 18:19:22 +00:00
John Kessenich
e28beee891 Preprocessor: Fixed that some comments incorrectly substituted a new line instead of space. Also generally cleaned up the space-related coding.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24387 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-06 16:13:47 +00:00
John Kessenich
8e789e8d62 Fixed a couple places that missed the error check for #else/#elif after #else.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24378 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-05 21:51:40 +00:00
John Kessenich
521ca375e0 Remove one layer of arrayness on geometry shader inputs before checking for location overlaps. I think there is a spec. bug here.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24377 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-05 20:58:16 +00:00
John Kessenich
0b39137009 Implement location overlap error checking.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24376 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-05 20:07:56 +00:00
John Kessenich
7fd9e1189b Track the flow-control (and {}) nesting level to prevent case statements from being a different nesting level than their switch statement.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24355 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-04 21:48:20 +00:00
John Kessenich
3a53006e0e Check for packing qualifiers on block members.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24353 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-04 21:01:32 +00:00
John Kessenich
afda2411c0 Check for structures out from vertex or into fragment for ES 100 or desktop pre-150.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24349 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-04 20:41:33 +00:00
John Kessenich
66cdf36521 Detect and give error on second occurrence of #version.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24347 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-04 20:08:16 +00:00
John Kessenich
b88c60b03f Track whether function declarations are prototypes, and only allow at most one prototype for ES 100.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24342 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-04 19:43:05 +00:00
John Kessenich
e1f0f5b31f Re-allow non-language characters in ES 100 comments, including '\', except for '\' just before a new line.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24331 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-04 17:23:03 +00:00
John Kessenich
34bd4fbef7 Fix ES unsized-array checking: it was one level too low, disallowing some unsized syntax that is legal.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24330 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-04 16:43:00 +00:00
John Kessenich
6ec8f28960 Update test results.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24303 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-03 21:05:07 +00:00
John Kessenich
143c8bf10f Give error when overloaded functions differ only on a parameter's precision qualifier.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24302 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-03 21:04:03 +00:00
John Kessenich
4e734dd68b Disallow non-language characters in comments for ES version 100.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24301 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-03 20:09:57 +00:00
John Kessenich
1abc4045ce Add #line functionality to allow expressions instead of just literals. Also made some preprocessor code slightly more clear.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24294 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-03 17:19:03 +00:00
John Kessenich
b06c378cc9 Non-functional: missing test result and slight coding change from yesterday's constant folding check in.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24293 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-03 16:13:22 +00:00
John Kessenich
a4ca22ff1d Finish compile-time constant folding for multi-argument built-ins: distance(), dot(), cross(), faceforward(), reflect(), refract(), and outerProduct().
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24272 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-03 01:18:06 +00:00
John Kessenich
13221d2f7a Fix logic error in steering which stages get bias vs. non-bias texturing functions.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24268 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-02 18:09:08 +00:00
John Kessenich
78fe3ace85 Fix crash from attempting ES precision propagation through a constant folded built-in function call when the expression tree has unknown precisions.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24267 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-02 16:38:53 +00:00
John Kessenich
98434bed00 Preprocessor fixes:
- Correctly handle non-directive lines starting with "#"
 - Correctly ignore unrecognized #pragma
 - Partial fix for new lines in the middle of macro invocation



git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24266 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-02 15:56:38 +00:00
John Kessenich
1fbaa35ce7 Compile-time check on sampler binding size, link-time merging and checking of bindings.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24218 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-27 02:41:52 +00:00
John Kessenich
d6bef9186b Correct textureGather*() extension support:
- add extension behavior and warning message for partial extension support
 - add partial support for gpu_shader5 for textureGather*
 - add interactions between texture rectangle and textureGather*
 - add checks to distinguish between gpu_shader5 and texture_gather extension feature differences


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24183 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-23 21:10:51 +00:00
John Kessenich
5b9f98854c Reflection: Eliminate redundant arrayed block entries, and use block name instead of instance name for active uniform enumeration.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24182 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-23 00:44:18 +00:00
John Kessenich
37d080c38a Add missing non-square matrixCompMult built-in functions.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24179 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-22 17:52:58 +00:00
John Kessenich
ad43f6f684 Implement GL_EXT_shader_texture_lod.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24177 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-22 17:30:34 +00:00
John Kessenich
04884e42ed Reflection: Expand out block arrays to N different blocks.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24159 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-21 00:54:57 +00:00
John Kessenich
1d1132d9eb Add limit checking for constant texture texel offsets and max_vertices.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24158 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-20 23:46:57 +00:00
John Kessenich
1e91f5ee8d Add link-time checks for max_vertices, input primitive, and output primitive for existence and matching.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24157 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-20 22:16:41 +00:00
John Kessenich
5134b9cf57 Track what ins/outs/uniforms are used, so that errors like "declare after use" or "can't use both XXX and YYY" can be issued. So far, used this for invariant, gl_FragColor et. al., and gl_FragCoord use before redeclaration.
Also made all tests in testlist include linker tests.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24156 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-20 21:12:43 +00:00
John Kessenich
e1dba1b59f Fix a preprocessor memory leak by cleaning up some preprocessor memory management.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24125 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-19 20:52:56 +00:00
John Kessenich
43e43ce77a Reflection: Flesh out expansions of complex aggregates not fully dereferenced, visit all array elements for a variable index, and correct max array index when a later occurrence is larger than an earlier one.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24080 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-15 20:41:31 +00:00
John Kessenich
c17dbd516f Reflection: Optimize leaf-array sizes for largest index used in a live path.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24073 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-15 05:28:51 +00:00
John Kessenich
12f9221e44 Reflection:
- correct block data size
 - handle deep dereference chains (block.member.member.member)
 - more clear interface argument names

(Still TBD: optimizing array size based on biggest used index and handling variable array index in middle of deep dereference chain)

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24072 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-15 01:34:27 +00:00
John Kessenich
ec252dfd3b Reflection: Add translation from glslang types to the API #define types.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24042 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-13 19:07:43 +00:00
John Kessenich
568bc3ae55 Reflection: Implement the std140 block offset calculation rules.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24027 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-13 05:40:44 +00:00
John Kessenich
ffa66d3bc7 Disallow arrays in initializers for non-array-object versions (assignment, etc. were already caught, but not initialization).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24022 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-12 22:02:36 +00:00
John Kessenich
029d746bad Fix line-continuation bug.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24021 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-12 22:01:32 +00:00
John Kessenich
69aa9c1b84 Fixes to scanning:
- do version checking for the line-continuation character
 - check for built-in names in #undef
 - bug fix for #elif after #else
 - do version checking for use of floating point suffixes (f, LF, etc.)


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24011 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-12 03:31:24 +00:00
John Kessenich
67c9f3a720 Misc semantics fixes:
- don't allow pre-array object versions to return a struct containing an array 
 - special case -2147483648 / -1
 - include "~" in the full integer functionality checks
 - handle multiple function parameters having the same name



git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24010 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-12 01:02:51 +00:00
John Kessenich
09709c1521 Don't allow invariant in a function.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24009 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-11 23:51:57 +00:00
John Kessenich
bd1a5b7727 Add GL_OES_EGL_image_external. Includes new keyword, type, name mangling, built-in function calls, etc.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24007 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-11 23:29:59 +00:00
John Kessenich
99296369d3 Add GL_EXT_frag_depth.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24003 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-11 20:51:50 +00:00
John Kessenich
06a37c3964 Add GL_OES_standard_derivatives. Also added extension infrastructure that allows built-in symbols to be tagged with extensions and automatically error checked against them.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24002 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-11 20:31:45 +00:00
John Kessenich
115a0adc29 Add GL_OES_texture_3D extension. Also, minor tweaks to extension adding infrastructure.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24001 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-11 18:50:06 +00:00
John Kessenich
359326b866 Minor consistency fix: Define built-in functions to have bodies.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23985 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-11 04:59:32 +00:00
John Kessenich
a4351c55e8 More subtle checking for redeclarations:
- 300 doesn't allow built-in overload, while 100 does, while neither allows redefining
 - block name can't be reused for block name within the same interface 
   (though, the spec. isn't clear about that, it's easier than verifying member matches, will file bug on it)


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23984 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-11 04:21:31 +00:00
John Kessenich
4d6570a1b3 Fix several issues in the preprocessor:
- macro expansion of hexidecimal numbers 
 - give errors instead of warnings/silence on extra tokens after #endif, #else, etc.
 - give errors on reserved macro name use, reuse of argument, and redefinition with different whitespace presence
 - detect and give error for all cases of #elif and #else after #else



git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23982 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-10 23:07:36 +00:00
John Kessenich
77d908af8a Added constant folding for relational (e.g. lessThan) built-ins, relational built-ins for uints, and bitwise ops for mixed scalars and vectors.
Also, allow comments to precede "#version 100".

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23974 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-09 00:18:22 +00:00
John Kessenich
0876a58203 Misc. constant-folding fixes: Check % for 0, mat(mat) constructor, index range checking (within constant objects). Also, rationalize addConst*() methods.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23973 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-08 21:47:56 +00:00
John Kessenich
01c22afa37 Add some missing invariant semantic checks, replace some misplaced sampler semantic checks, add parameter and structure member checks against new qualifiers.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23962 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-08 07:13:18 +00:00
John Kessenich
c999ba2816 Complete hook up all the compile/link errors to the command-line exit status. (Also, an updated test left from the last check-in.)
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23961 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-07 23:33:24 +00:00
John Kessenich
b0a7eb599b Stop emitting the "#version missing" warning, and hook up the existing "suppress warnings" to a command-line option (-w).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23952 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-07 17:44:20 +00:00
John Kessenich
3ac3578968 Fix some Linux issues.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23939 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-07 01:36:56 +00:00
John Kessenich
11f9fc7247 Add and partially implement an interface for doing uniform reflection. It includes an AST traversal to identify live accesses.
It does not yet correctly compute block offsets, give correct GL-API-style type values, or handle arrays.

This is tied to the new -q flag.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23938 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-07 01:06:34 +00:00
John Kessenich
8ec55cdcd2 Clean up/resolve a bunch of TODO, which included implementing pixel_center_integer and origin_upper_left and adjusting what versions see legacy texturing names.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23874 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-05 18:07:25 +00:00
John Kessenich
5b0f13acbc Include per-shader and per-program pools in the new C++ interface to glslang. (And picked up missing test result from previous check in.)
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23844 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-01 03:08:40 +00:00
John Kessenich
83a6b1edfc Fix parameter count bug in ambiguity checking for overloaded function matching under implicit conversions.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23827 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-31 18:05:50 +00:00
John Kessenich
0d22e31c75 Implement 1.20 style function signature matching under implicit conversion. This was the last key unimplemented feature of versions 120 through 330.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23798 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-30 23:17:34 +00:00
John Kessenich
8cbd18ecaa Fix recursion detection (it was detecting cycles in the call graph that were not directed cycles).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23761 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-30 01:22:04 +00:00
John Kessenich
e17ef84753 Fix bug where bracket dereferences were incorrectly keeping the base's qualifier (for example constBase[i] would still be a const instead of EvqTemporary).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23722 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-28 19:49:16 +00:00
John Kessenich
ea869fb403 Improve preprocessor by using GLSL scanner, allowing read-only strings to be compiled, unifying of line # tracking, and correct detection that ES #version appeared after a comment.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23721 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-28 18:12:06 +00:00
John Kessenich
9497485e14 Add geometry shader input array sizing/checking WRT declared input primitive layout.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23698 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-24 22:41:04 +00:00
John Kessenich
ab41fe5df6 Add redeclarations of built-in blocks.
Note: lots of test results changed due to listing the members of a block when printing types.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23682 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-24 01:25:40 +00:00
John Kessenich
94fdd1117b Add geometry-shader stream, invocations, max_vertices, lines, triangles, etc. layout qualifiers, and their default/inheritance behaviors, and some other misc. geometry shader features. (Geometry shaders are not yet done though.)
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23679 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-23 19:34:05 +00:00
John Kessenich
284231c9c5 Add built-in constants through version 440. Some still need to be consumed when initializing the symbol table.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23634 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-22 01:50:39 +00:00
John Kessenich
c78a126ba6 Tie "location = " to the right stages/versions/extensions. Also add "#define extension 1" extension support and instructions.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23633 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-22 00:21:04 +00:00
John Kessenich
21a8770f92 Add texture gather functions (and extension check) for GLSL 400 and GL_ARB_texture_gather.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23631 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-21 19:25:59 +00:00
John Kessenich
ab3080353a Add layout binding qualifier for blocks and samplers (atomics are not yet in, nor link validation).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23590 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-18 21:37:55 +00:00
John Kessenich
8f13e1322d Add swizzles to scalars.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23580 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-18 03:56:23 +00:00
John Kessenich
8d8f4cc408 Minor preprocessor fix for error message line/string numbers coming from source line, not macro line.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23576 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-18 03:09:37 +00:00
John Kessenich
e46b087760 Add function "const", where the initializer does not have to be a compile-time constant.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23566 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-17 20:55:30 +00:00
John Kessenich
779e6b406a Add C-style curly-brace initializers.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23565 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-17 19:43:43 +00:00
John Kessenich
e7c59c187c Add all built-in variables for all versions/profiles/stages of GLSL. Also, made more readable; declarations are cut and paste from the specs, with quotes around them. This does not include built-in constants yet (other than MaxClipDistances), just the non-constants.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23551 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-16 22:28:35 +00:00
John Kessenich
457145ded5 Have block members use EvqVaryingIn rather than EvqIn, etc., confining the EvqIn-class of qualifier just to parameters and parse time (before it's known if something is a parameter). Also, have member error messages report their actual line, rather than the block's line.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23499 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-16 04:08:21 +00:00
John Kessenich
fb57e7cc5e Add ES 3.0 fragment output link-time test for outputs having or not having location qualifiers.
Also split linker validation into its own file, removed dead "QualifierAlive" files, printed errors for parsing problems with built-in symbols,  updated the Windows binary, and added some tests.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23490 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-15 21:46:20 +00:00
John Kessenich
27b72e42c3 Implement ES 2.0 (version 100) limitations for non-inductive loop detection and array indexes needing "constant-index-expressions" (inductive variables and constant expressions).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23478 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-14 22:42:16 +00:00
John Kessenich
a4ea1313c3 Turn on non-uniform blocks (in/out/buffer), and prevent new stages from working with "no profile" (before 150) shaders.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23470 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-11 19:46:10 +00:00
John Kessenich
3afe67dcc2 Non-functional: Remove use of the unused structure 'remapper', and other minor internal improvements. Triggered by some bigger changes in the works. Also, turned on an existing test that was not included in the test list.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23426 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-09 00:20:26 +00:00
John Kessenich
98c2ef25de Non-functional changes: Typo in error message and in comment, remove unneeded arguments, separate constructor-op mapping from handling constructors.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23389 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-05 19:03:50 +00:00
John Kessenich
816e9bc90b Improve robustness of extension checking, and its intersection with ES 100 features.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23388 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-04 21:09:36 +00:00
John Kessenich
a5830dfc0e Add the following ESSL 2.0 (#version 100) limitations to the configuration file, internal infrastructure, and test cases. Still need to implement the actual detection of non-inductive loops and array accesses. While and do-while loop detection is done.
nonInductiveForLoops
whileLoops
doWhileLoops
generalUniformIndexing
generalAttributeMatrixVectorIndexing
generalVaryingIndexing
generalSamplerIndexing
generalVariableIndexing
generalConstantMatrixVectorIndexing


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23323 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-02 05:10:48 +00:00
John Kessenich
44e8cae80a Allow ES version 100 to redeclare built-in functions.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23322 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-02 01:30:14 +00:00
John Kessenich
447fc3613a Add message indicating level of completeness for not-yet-complete versions.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23313 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-01 23:13:50 +00:00
John Kessenich
2ecdd14288 Add function recursion testing to the link-time validation.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23309 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-01 21:58:43 +00:00
John Kessenich
f2ee3dd46a Add full support for uniforms with initializers, including intra-stage link validation of aggregate constant initializers.
This included 
 - encapsulating aggregate constants
 - removal of constant-aggregate comparison algorithms, instead using a flattened and direct std::vector comparison
 - adding structure type comparison for independently declared structures that still might match types



git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23274 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-09-28 04:02:08 +00:00
John Kessenich
9839e2440e Unify the 8 grammar productions for declaring variables. This greatly simplifies making changes for this set of productions.
This change also naturally picks up redeclarations of built-in arrays and the addition of the remaining linker objects of const, arrays, etc.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23246 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-09-26 00:45:21 +00:00
John Kessenich
337dbc7d8c Add basic intra-stage linking validation for matching types and qualification of uniforms/ins/outs/globals, function body duplication, and mixing ES/non-ES shaders.
Still need to handle arrays and built-in redeclarations, and many more rules, but this puts the basics in place.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23225 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-09-24 21:18:46 +00:00
John Kessenich
f5ebfb5f27 Test for and prevent any dead-code elimination, as all code is needed in the AST for static-use analysis.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23163 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-09-20 06:20:21 +00:00
John Kessenich
05a7063007 Add optional configuration file for specifying (existing) limits. Details explained by usage statement. More limits to be added in the future.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23105 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-09-17 19:26:08 +00:00
John Kessenich
b84b700d90 Basic infrastructure for redeclaring built-in variables (like gl_FragCoord) so shaders can change their type/layout.
A modifiable copy is made at the shader's global scope.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23103 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-09-17 18:45:24 +00:00
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
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
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
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
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
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
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
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
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
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
ebf0825ec4 Add the 6 hyperbolic trig functions.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22149 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-24 22:40:19 +00:00
John Kessenich
eebed6f60b Disallow variable indexing into sampler array for ES and desktop before version 400.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22148 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-24 21:52:41 +00:00
John Kessenich
01fc0645cb Add semantic checks for order of qualification and repetition within a class of qualifiers.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22145 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-24 21:22:03 +00:00
John Kessenich
06f8464fb5 Create linkage symbol nodes in the AST so a linker has access to all global objects that were declared, for error checking, etc. Use it now for all ins/outs/uniforms as well as gl_VertexID and gl_InstanceID.
Also fixed a confusing name and added more 'const'.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22142 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-24 17:26:56 +00:00
John Kessenich
b29ba33089 Fix bug of accidentally overriding initial layout location with 0, which does not mean no location. Added in/out structure tests.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22120 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-21 19:43:44 +00:00
John Kessenich
211cba242b Add grammar productions for the syntax "layout(...) uniform;" for setting global defaults.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22112 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-20 22:54:40 +00:00
John Kessenich
60d9f7a881 Add grammar productions for adding 'invariant' to already declared variables.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22083 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-19 20:44:17 +00:00
John Kessenich
41a36bbb2f Track separate precision defaults for each kind of sampler, give initial defaults as per spec. Also make fragment floats have no default. Modify/add tests to adapt to these changes.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22066 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-19 05:41:25 +00:00
John Kessenich
f78fff94e9 Implement __VERSION__ macro, make ftransform() non-ES only, add more tests.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22000 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-13 23:56:04 +00:00
John Kessenich
fb7044a9a8 Semantic checks: ES doesn't have unsized arrays or noise*().
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21998 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-13 20:16:43 +00:00
John Kessenich
fbe01520b6 Get all the scoping rules right for ES and non ES, name hiding, built-in overriding, etc.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21948 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-12 06:13:17 +00:00
John Kessenich
a5cecfc6b6 Add constant folding for the exp*(), log*(), *sqrt(), round*(), floor(), fract(), ceil(), abs(), and sign() built in functions.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21927 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-11 00:09:48 +00:00
John Kessenich
fddf3ce3a1 Unify constant floats and constant doubles; they can all be constant doubles.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21921 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-10 21:56:23 +00:00
John Kessenich
50a8cabbbb Add constant folding for length(), normalize(), fwidth(), dFdx(), and dFdy().
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21918 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-10 07:37:49 +00:00
John Kessenich
00f605b930 A round of increasing robustness against buffer overruns.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21917 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-10 07:36:26 +00:00
John Kessenich
3ce5745ade Add more tests for built-in variables.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21893 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-07 18:54:19 +00:00
John Kessenich
0fbb0c4930 Block/structure fixes: Merge qualifiers with multiple declarators, handle arrays of blocks, more semantic checks for what's allowed.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21883 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-06 18:31:21 +00:00
John Kessenich
ceb0623823 Fix another problem with undefined macros needing to evaluate to 0 within a preprocessor expression, but not outside a preprocessor expression.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21815 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-03 04:15:57 +00:00
John Kessenich
04de88f990 The new test that was to have been added with the previous check in.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21814 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-06-02 22:57:37 +00:00
John Kessenich
2327da4784 Add test for operation semantics, fix one bug it found.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21798 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-05-30 23:31:38 +00:00
John Kessenich
8d00fd0e29 Add missing type check for operands having the same type (after conversion) around the ":" in a "?:" operation.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21721 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-05-28 07:29:58 +00:00
John Kessenich
2d0f1e5424 Add precision qualifier propagation for swizzling, texture lookups, built-in funtions mapped to operators, comma op, and more robustly propagate for all binary/unary ops.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21622 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-05-17 02:51:45 +00:00
John Kessenich
52ac67e913 Make the PP report an error on undefined macro in "#if ..." for ES profiles, unless relaxed error checking is requested. Still works as normal CPP on non-ES.
Also, improved error reporting in general for the PP.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21417 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-05-05 23:46:22 +00:00
John Kessenich
c2ff7702be For all keywords already present, get correct when they could be identifiers, are reserved words, or are keywords, for all versions of ESSL and GLSL.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21282 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-04-25 16:44:03 +00:00
John Kessenich
0576126005 Add switch/case/default statements, using a switch node that contains a sequence of case/default nodes and top-level nodes of the code chunks in between them.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21131 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-04-12 03:57:02 +00:00
John Kessenich
b51f62c573 Add the GL_ES macro for ES personalities, along with a general mechanism for adding preambles in front of shaders without effecting line numbers, etc.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21122 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-04-11 16:31:09 +00:00
John Kessenich
63eed3867a Additional layout-related error checking.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21108 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-04-10 23:30:05 +00:00
John Kessenich
bcd79fe5a3 Implement default layout qualifiers at global and block levels with proper inheritance. Also add more error checking of qualifiers.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21107 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-04-10 22:26:56 +00:00
John Kessenich
ba04210097 Add anonymous members as a new symbol table type, so the infrastructure can handle blocks with no names.
Also, add more safety to the types involved regarding copy constructors, operator=, etc.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21106 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-04-10 20:15:16 +00:00
John Kessenich
f6648dc12c Add interface blocks as a basic type and handle uniform blocks that have an instance name. Includes handling qualifiers on structure members.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21093 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-04-10 02:06:46 +00:00
John Kessenich
e9942d26f5 Initial implementation of layout qualifiers. More to come after uniform blocks are in place.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21078 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-04-09 01:20:01 +00:00
John Kessenich
3ed2db58f1 Put in correct rules for multiple versions of qualification and typing of inputs and outputs. Also, removed EvqAttribute, merging it with EvqVaryingIn.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21064 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-04-07 22:43:16 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
John Kessenich
564842b23b Properly declare versions for precision qualifiers, in/out/attribute/varying.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20083 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-01-10 18:20:47 +00:00
John Kessenich
f59bfa07e0 Support in/out for stage inputs/outputs, tied to being desktop version 150 or ES 300.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20077 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-01-10 01:47:54 +00:00
John Kessenich
f20bb0eb94 Add a simple test list for regression testing. A much broader test base is needed, however.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@19954 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2012-12-13 01:37:04 +00:00
John Kessenich
9fd55bd338 Add a new shader-versioning infrastructure capable of handling multiple profiles, desktop/ES, many versions, features coming and going in different versions across different profiles, and extensions.
NB: *Use* of this infrastructure is so far only skeletal.

Fixed a few typos and minor issues along the way.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@19951 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2012-12-13 00:05:26 +00:00