Commit Graph

47 Commits

Author SHA1 Message Date
Malcolm Bechard
275d7ae882 only declare compatibility gl_ variables in compatibility mode
avoid declaring them in GLSL 1.50+ if core profile is chosen by the
version statement

fixes #2663
2021-06-10 21:52:09 -04:00
John Kessenich
1c3ab274b1 Test Results Only: Include size in implicitly sized arrays (change to unsized).
This effects 60 tests, in a trivial way, but is critical to factor out this
noise from future planned changes.
2018-03-25 14:05:38 -06:00
John Kessenich
e00e8f45a6 GLSL: replace general missing functionality with specific messages. 2017-06-05 16:42:33 -06:00
John Kessenich
71c100d7c0 GLSL output: Removed fixed-size buffer; fixes #769.
Makes some white-space differences in most output, plus a few cases
where more could have been put out but was cut short by the previous
fix-sized buffer.
2017-03-14 19:51:29 -06:00
John Kessenich
c142c88967 Front-ends: Non-functional: Rationalize vector and matrix swizzles.
This reduces code duplication in a few ways, and better encapsulates
vector swizzle representation.
2017-01-13 19:35:29 -07:00
John Kessenich
906cc21816 Linker: Eliminate uncalled functions, because they can be ill-defined.
Fixes issue #610. Also provides a testing option to keep uncalled functions.
2016-12-09 19:22:20 -07:00
John Kessenich
d3f1122a44 Whole stack: Fix stale types in the AST linker object nodes, fixing #557.
Rationalizes the entire tracking of the linker object nodes, effecting
GLSL, HLSL, and SPIR-V, to allow tracked objects to be fully edited before
their type snapshot for linker objects.

Should only effect things when the rest of the AST contained no reference to
the symbol, because normal AST nodes were not stale. Also will only effect such
objects when their types were edited.
2016-11-05 10:22:33 -06:00
John Kessenich
7208473c69 PP: Non-functional; fix typos and blank spaces. 2016-07-30 13:25:33 -06:00
John Kessenich
cc16fa0720 Tests: Move to just linefeed to simply cross-platform test changes. 2015-12-10 18:01:54 -07:00
John Kessenich
65c78a0b62 Array of array: Implement the core functionality: types, constructors, operations.
There will be subsequent commits to refine semantics, esp. version-specific semantics,
as well as I/O functionality and restrictions.

Note: I'm getting white-space differences in the preprocessor test results,
which I'm not checking in.  I think they need to be tagged as binary or something.
2015-08-10 17:08:55 -06:00
John Kessenich
e0603a441e Front-end: move to rational internal array-of-array interfaces and design. (A-of-A is not yet implemented though.) 2015-07-06 21:00:03 -06:00
John Kessenich
dff18a2be0 glslang: Formally track all built-in variables, right from the beginning, to enable avoiding all textual compares at any subsequent stage in the stack. (To be used in future check ins.)
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31224 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-05-18 16:45:49 +00:00
John Kessenich
af9ab5f743 glslang parser: Arrays-of-arrays name-mangling and error messages (lots of A-of-A stuff to come a bit later). This patch from Google, David Neto <dneto@google.com>.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31137 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-05-11 16:16:49 +00:00
John Kessenich
8b37b04ecc glslang AST output: include global vs. temp (local) in the printed output. This only effects test results, but a future check-in is going to fix some globals.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@30973 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-04-29 10:16:56 +00:00
John Kessenich
f0fce80aa7 Do qualifier-based checking independent of declaring a variable. Bug 11903.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@28502 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-10-08 21:29:29 +00:00
John Kessenich
aa657c117e Implement 'index' layout qualifier for fragment outputs. Based partly on a submission.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27759 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-08-19 02:12:44 +00:00
John Kessenich
d1888f83f6 Implement conservative depth layout qualifiers. Based partly on a submission.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27758 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-08-18 21:27:53 +00:00
John Kessenich
ddea678e3e Implement GL_ARB_shader_image_load_store. Partly done (format layout qualifiers) from a submission.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27670 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-08-10 18:19:36 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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