platform/upstream/glslang.git
8 years agoMerge pull request #55 from srk-lunarg/v31_type_fixes
John Kessenich [Tue, 11 Aug 2015 20:24:34 +0000 (14:24 -0600)]
Merge pull request #55 from srk-lunarg/v31_type_fixes

Add missing OpTypeSampledImage to prevent unknown type error from SPV…

8 years agoAdd missing OpTypeSampledImage to prevent unknown type error from SPVRemapper.
Steve [Tue, 11 Aug 2015 15:20:14 +0000 (09:20 -0600)]
Add missing OpTypeSampledImage to prevent unknown type error from SPVRemapper.

8 years agoArray of array: Implement the core functionality: types, constructors, operations.
John Kessenich [Mon, 10 Aug 2015 23:08:55 +0000 (17:08 -0600)]
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.

8 years agoArray of Array prep: Turn a batch of 0's into nullptr or UnsizedArraySize.
John Kessenich [Sun, 9 Aug 2015 20:27:34 +0000 (14:27 -0600)]
Array of Array prep: Turn a batch of 0's into nullptr or UnsizedArraySize.

Added some const as well. This will remove camouflage of the next commit,
which will add the bulk of Array of Array semantics and functionality.
(Note the basic grammar and data structure is already in place.)

8 years agoAdd new SPIR-V 31 files.
John Kessenich [Fri, 7 Aug 2015 04:59:24 +0000 (22:59 -0600)]
Add new SPIR-V 31 files.

8 years agoMove to revision 31 of SPIR-V.
John Kessenich [Fri, 7 Aug 2015 04:53:06 +0000 (22:53 -0600)]
Move to revision 31 of SPIR-V.

8 years agoCreate last version before going to SPIR-V Revision 31.
John Kessenich [Fri, 7 Aug 2015 04:19:45 +0000 (22:19 -0600)]
Create last version before going to SPIR-V Revision 31.

8 years agoMerge pull request #53 from google/get-string-name-or-num
John Kessenich [Fri, 7 Aug 2015 04:06:34 +0000 (22:06 -0600)]
Merge pull request #53 from google/get-string-name-or-num

Add getStringNameOrNum() in TSourceLoc.

8 years agoFixes to 8f1684b7bb881813365efd013b05bc0900a52a0c, merge pull request 52.
John Kessenich [Fri, 7 Aug 2015 04:02:24 +0000 (22:02 -0600)]
Fixes to 8f1684b7bb881813365efd013b05bc0900a52a0c, merge pull request 52.

8 years agoMerge pull request #52 from baldurk/gcc-warn-fixes
John Kessenich [Fri, 7 Aug 2015 03:03:57 +0000 (21:03 -0600)]
Merge pull request #52 from baldurk/gcc-warn-fixes

Compile fixes for gcc -Wall

8 years agoMerge pull request #51 from baldurk/size-t-int-warning-fixes
John Kessenich [Fri, 7 Aug 2015 02:43:13 +0000 (20:43 -0600)]
Merge pull request #51 from baldurk/size-t-int-warning-fixes

Remove unsigned/size_t downcast (warning when building on x64)

8 years agoCreate a new method to return string name or number to DRY code.
Lei Zhang [Tue, 21 Jul 2015 19:18:40 +0000 (15:18 -0400)]
Create a new method to return string name or number to DRY code.

8 years agoCompile fixes for gcc -Wall
baldurk [Wed, 5 Aug 2015 18:54:58 +0000 (20:54 +0200)]
Compile fixes for gcc -Wall

8 years agoRemove unsigned/size_t downcast (warning when building on x64)
baldurk [Wed, 5 Aug 2015 18:24:26 +0000 (20:24 +0200)]
Remove unsigned/size_t downcast (warning when building on x64)

8 years agoMerge pull request #50 from google/remove-unused-code
John Kessenich [Wed, 5 Aug 2015 18:07:48 +0000 (12:07 -0600)]
Merge pull request #50 from google/remove-unused-code

Remove unused members from TPpContext

8 years agoRemove unused members from TPpContext.
David Neto [Fri, 24 Jul 2015 12:12:36 +0000 (08:12 -0400)]
Remove unused members from TPpContext.

The ErrMsg and ifloc members were unused or had no effect.

8 years agoMerge pull request #46 from google/include-directive
John Kessenich [Wed, 5 Aug 2015 16:29:23 +0000 (10:29 -0600)]
Merge pull request #46 from google/include-directive

#include directive support

8 years agoCreate a new ppRequireExtensions method for preprocessor.
Lei Zhang [Wed, 5 Aug 2015 15:56:14 +0000 (11:56 -0400)]
Create a new ppRequireExtensions method for preprocessor.

Now extensions required by preprocessor should be checked via
the ppRequireExtensions method. This is more clear and coherent
with the rest of the code.

8 years agoRevisioning: Include GLSL.std.450 version. Also, the revision.h script now includes...
John Kessenich [Sun, 2 Aug 2015 22:11:21 +0000 (16:11 -0600)]
Revisioning: Include GLSL.std.450 version.  Also, the revision.h script now includes redirection to revision.h.

8 years agoVersion reporting: Restart active use of revision.h, now based on a git tag.
John Kessenich [Sat, 1 Aug 2015 23:10:02 +0000 (17:10 -0600)]
Version reporting: Restart active use of revision.h, now based on a git tag.

The new make-revision script regenerates glslang/Include/revision.h,
used as it always has been, but made with a git-tag version and the
the number of commits on master.

I have a pre-commit hook that will automatically do this on master,
likely often enough to work in practice, without needing pull requests
to include it.

8 years agoMerge branch 'master' of https://github.com/KhronosGroup/glslang
John Kessenich [Sat, 1 Aug 2015 03:22:43 +0000 (21:22 -0600)]
Merge branch 'master' of https://github.com/KhronosGroup/glslang

8 years agoUpdate Linux binary
John Kessenich [Sat, 1 Aug 2015 03:20:53 +0000 (21:20 -0600)]
Update Linux binary

8 years agoUpdate Window's binary
John Kessenich [Sat, 1 Aug 2015 03:15:54 +0000 (21:15 -0600)]
Update Window's binary

8 years agoOutput wrapping #line directives for included content.
Lei Zhang [Mon, 6 Jul 2015 14:32:46 +0000 (10:32 -0400)]
Output wrapping #line directives for included content.

Also changed the includer interface to let it return the actual
full path of the included file.

8 years agoUpdate scanner in TParseContext when changing the input stream.
Lei Zhang [Sun, 5 Jul 2015 20:50:21 +0000 (16:50 -0400)]
Update scanner in TParseContext when changing the input stream.

After parsing a #include directive, we push a TokenizableString
which contains the content of the included file into the input
stack. Henceforth, tokens will be read from the newly pushed
TokenizableString. However, the scanner in TParseContext still
points to the previous input stream. We need to update the scanner
to point to the new input stream inside TokenizableString. Thus,
the setCurrent{String|Line|..} method in TParseContext updates
the status of the correct input stream. After finishing the newly
pushed TokenizableString, we need to restore the scanner to the
previous input stream.

8 years agoUse extension framework to enable #include directive.
Lei Zhang [Thu, 16 Jul 2015 21:33:10 +0000 (17:33 -0400)]
Use extension framework to enable #include directive.

This patch introduces a new extension, GL_GOOGLE_include_directive,
to enable support #include directives. It depends on the extension
GL_GOOGLE_cpp_style_line_directive.

8 years agoAdd #include processing to glslang (though turned off by default).
Dejan Mircevski [Wed, 17 Jun 2015 15:40:33 +0000 (11:40 -0400)]
Add #include processing to glslang (though turned off by default).

When an include directive is recognized by the preprocessor, it
executes a callback on the filepath argument to obtain the file
contents.  That way the compilation client can deal with the file
system, include paths, etc.

Currently only accepts quoted filepaths -- no angle brackets yet.

8 years agoMerge pull request #45 from google/source-string-name
John Kessenich [Fri, 31 Jul 2015 23:38:27 +0000 (17:38 -0600)]
Merge pull request #45 from google/source-string-name

Add mechanism for specifying names for source strings.

9 years agoAdd mechanism for specifying names for source strings.
Lei Zhang [Tue, 21 Jul 2015 14:23:43 +0000 (10:23 -0400)]
Add mechanism for specifying names for source strings.

Expose a new method setStringsWithLengthsAndNames() in the interface
which allows the caller to set descriptive names for source strings.
These names can be used in error messages.

9 years agoNon-functional: Slight change to the Google #include implementation to separate it...
John Kessenich [Wed, 29 Jul 2015 01:01:16 +0000 (19:01 -0600)]
Non-functional: Slight change to the Google #include implementation to separate it from AEP.

9 years agoMerge pull request #43 from google/cpp-style-line-directive
John Kessenich [Wed, 29 Jul 2015 00:55:44 +0000 (18:55 -0600)]
Merge pull request #43 from google/cpp-style-line-directive

Extend the syntax of #line and __FILE__ to support filename strings.

The implementation is done via introducing a new extension
GL_GOOGLE_cpp_style_line_directive using the extension framework.

The purpose is to support cpp-style #line directives, which is
required by #include.

9 years agoUse const reference for TSourceLoc in interfaces.
Lei Zhang [Tue, 28 Jul 2015 16:45:41 +0000 (12:45 -0400)]
Use const reference for TSourceLoc in interfaces.

9 years agoUse requireExtensions() to check extension and turn on more tests.
Lei Zhang [Tue, 28 Jul 2015 15:59:24 +0000 (11:59 -0400)]
Use requireExtensions() to check extension and turn on more tests.

Use requireExtensions() to check GL_GOOGLE_cpp_style_line_directive
is turned on. Add register more tests for running.

9 years agoExtend the syntax of #line and __FILE__ to support filename strings.
Lei Zhang [Thu, 25 Jun 2015 21:53:54 +0000 (17:53 -0400)]
Extend the syntax of #line and __FILE__ to support filename strings.

According to the GLSL spec, the second parameter to #line should be
an integer source string number and __FILE__ will be substituted
with the integer source string number currently processed. This
patch extends the syntax of #line and __FILE__. Now #line accepts
as the second parameter a filename string quoted by double quotation
marks. And if such a #line is set, __FILE__ will be substituted with
the currently set filename string. The implementation is done via
introducing a new extension GL_GOOGLE_cpp_style_line_directive using
the extension framework.

The purpose is to support cpp-style #line directives, which is
required by #include.

9 years agoScanning: 1) rationalize end-of-input everywhere, 2) prevent infinite loop at end...
John Kessenich [Mon, 27 Jul 2015 15:37:55 +0000 (09:37 -0600)]
Scanning: 1) rationalize end-of-input everywhere, 2) prevent infinite loop at end-of-input, 3) use positive chars.

Fixes issue #25. (char 255 aliased to -1 and missing tests for end of input).

1) All layers of input scanning now share a single EndOfInput value.
This avoids translation of it across layers of encapsulation.

2) Some places looking for end of line were not stopping on EndOfInput.

3) Use of "char" for the input made char values > 127 be negative numbers.
This allowed for aliasing of 255 to -1, etc.  This is fixed by using
unsigned char.

9 years agoIssue #39: Prevent problem of inserting a zero-length symbol after cascading errors.
John Kessenich [Sun, 26 Jul 2015 00:14:09 +0000 (18:14 -0600)]
Issue #39: Prevent problem of inserting a zero-length symbol after cascading errors.

9 years agoPreprocessor: Allow '\' as a token, which gets actual use in #error, but should have...
John Kessenich [Sat, 25 Jul 2015 23:34:32 +0000 (17:34 -0600)]
Preprocessor: Allow '\' as a token, which gets actual use in #error, but should have no other use.

This is just for '\' that's not before a new line.
Note the specification says it has no use other than as line continuation,
but #error is a grey area. (There are no escape sequences.)

9 years agoConsolidate all token length limits (1024), including one bad one (80) hardcoded...
John Kessenich [Sat, 25 Jul 2015 20:02:53 +0000 (14:02 -0600)]
Consolidate all token length limits (1024), including one bad one (80) hardcoded on the stack (issue #40, issue #41).

9 years agoMerge pull request #44 from fkaa/osx-const-key-fix
John Kessenich [Sat, 25 Jul 2015 18:51:02 +0000 (12:51 -0600)]
Merge pull request #44 from fkaa/osx-const-key-fix

Fix missing const qualifier on TUnorderedMap template type

9 years agoFix missing const qualifier on TUnorderedMap template type
Felix Kaaman [Sat, 25 Jul 2015 14:31:50 +0000 (16:31 +0200)]
Fix missing const qualifier on TUnorderedMap template type

9 years agoPortability: Make previous merge work with MSVS 2012.
John Kessenich [Fri, 24 Jul 2015 21:15:55 +0000 (15:15 -0600)]
Portability: Make previous merge work with MSVS 2012.

9 years agoMerge pull request #38 from google/preprocessing-line-number
John Kessenich [Fri, 24 Jul 2015 21:05:17 +0000 (15:05 -0600)]
Merge pull request #38 from google/preprocessing-line-number

Preprocessing line number handling

9 years agoDoPreprocessing() should consider source string change.
Lei Zhang [Thu, 9 Jul 2015 20:58:42 +0000 (16:58 -0400)]
DoPreprocessing() should consider source string change.

Everytime we switch to a new source string, the line are reset.
We need to reset lastLine and also output newlines appropriately.

9 years agoCreate a new class to keep track of line number in preprocessor.
Lei Zhang [Wed, 15 Jul 2015 15:41:20 +0000 (11:41 -0400)]
Create a new class to keep track of line number in preprocessor.

SourceLineSynchronizer is added for keeping track of the last
line number and output newlines appropriately if we switch to
a new line in the preprocessor.

9 years agoAST -> SPV testing: Update test for using new TbdFunctionality() that is non-fatal...
John Kessenich [Thu, 23 Jul 2015 16:25:20 +0000 (10:25 -0600)]
AST -> SPV testing: Update test for using new TbdFunctionality() that is non-fatal and uniquifies printed TBDs.

9 years agoAST -> SPV: Add basic atomic_uint and atomic*() built-in function functionality.
John Kessenich [Thu, 23 Jul 2015 16:22:48 +0000 (10:22 -0600)]
AST -> SPV: Add basic atomic_uint and atomic*() built-in function functionality.

9 years agoFront-end atomics: Finish adding atomic built-in functions (non-image) into the AST.
John Kessenich [Thu, 23 Jul 2015 01:58:15 +0000 (19:58 -0600)]
Front-end atomics: Finish adding atomic built-in functions (non-image) into the AST.

9 years agoTodo.txt: Added key, including notation for who's working on something.
John Kessenich [Wed, 22 Jul 2015 22:39:12 +0000 (16:39 -0600)]
Todo.txt: Added key, including notation for who's working on something.

9 years agoUpdate Todo.txt.
John Kessenich [Wed, 22 Jul 2015 22:36:38 +0000 (16:36 -0600)]
Update Todo.txt.

9 years agoPortability: Remove unneeded "= default" to work with older compilers.
John Kessenich [Wed, 22 Jul 2015 21:24:53 +0000 (15:24 -0600)]
Portability: Remove unneeded "= default" to work with older compilers.

9 years agoMerge pull request #31 from google/explicit-extension-directive
John Kessenich [Wed, 22 Jul 2015 21:20:54 +0000 (15:20 -0600)]
Merge pull request #31 from google/explicit-extension-directive

Only output explicit extension directives in preprocessing.

9 years agoIssue 32: Guard against constructors consuming unsized arrays.
John Kessenich [Wed, 22 Jul 2015 17:44:59 +0000 (11:44 -0600)]
Issue 32: Guard against constructors consuming unsized arrays.

9 years agoMerge pull request #33 from google/spv-builder-loop-ctor-inits-all-members
John Kessenich [Wed, 22 Jul 2015 17:39:29 +0000 (11:39 -0600)]
Merge pull request #33 from google/spv-builder-loop-ctor-inits-all-members

spv::Builder::Loop constructor inits all members.

9 years agospv::Builder::Loop constructor inits all members.
David Neto [Fri, 17 Jul 2015 21:11:22 +0000 (17:11 -0400)]
spv::Builder::Loop constructor inits all members.

After construction, the Loop is effectively const.

This perturbs the IDs in SPIR-V tests because the body block
is created before generating any of the loop code, rather than
only when the body is first referenced.

9 years agoIssue #28: Correctly handle a single input argument conversion when the input argumen...
John Kessenich [Tue, 21 Jul 2015 22:00:34 +0000 (16:00 -0600)]
Issue #28: Correctly handle a single input argument conversion when the input argument is an aggregate.

9 years agoOnly output explicit extension directives in preprocessing.
Lei Zhang [Thu, 16 Jul 2015 22:34:55 +0000 (18:34 -0400)]
Only output explicit extension directives in preprocessing.

Preprocessing output shouldn't contain extensions enabled as
dependencies.

9 years agoIssue #26: Detect empty array constructors, require at least on operand.
John Kessenich [Tue, 21 Jul 2015 20:35:39 +0000 (14:35 -0600)]
Issue #26: Detect empty array constructors, require at least on operand.

9 years agog++: Fix compilation issue with templates in g++.
John Kessenich [Tue, 21 Jul 2015 06:07:52 +0000 (00:07 -0600)]
g++: Fix compilation issue with templates in g++.

9 years agoPerf: Put in a portable std::hash that works with the pool. This turns on the 10...
John Kessenich [Tue, 21 Jul 2015 05:59:32 +0000 (23:59 -0600)]
Perf: Put in a portable std::hash that works with the pool.  This turns on the 10-15% perf gain.

9 years agoSPV: Make previous commit compile with MSVC 2012.
John Kessenich [Tue, 21 Jul 2015 04:34:49 +0000 (22:34 -0600)]
SPV: Make previous commit compile with MSVC 2012.

9 years agoMerge pull request #22 from google/structured-do-while
John Kessenich [Tue, 21 Jul 2015 04:14:38 +0000 (22:14 -0600)]
Merge pull request #22 from google/structured-do-while

Generate correctly structured do-while loops.

9 years agoPreprocessor: Prevent (and give an error on) expression division by 0.
John Kessenich [Mon, 20 Jul 2015 18:29:41 +0000 (12:29 -0600)]
Preprocessor: Prevent (and give an error on) expression division by 0.

9 years agoTests: Increase testing around incorrect use of block names and instances.
John Kessenich [Mon, 20 Jul 2015 18:03:04 +0000 (12:03 -0600)]
Tests: Increase testing around incorrect use of block names and instances.

9 years agoFront end: Prevent use of a block name, which has no other use in a shader.
John Kessenich [Mon, 20 Jul 2015 17:35:51 +0000 (11:35 -0600)]
Front end: Prevent use of a block name, which has no other use in a shader.

9 years agoFix g++ build break (portibility problems with stl hash). This partly turns off...
John Kessenich [Mon, 20 Jul 2015 08:06:22 +0000 (02:06 -0600)]
Fix g++ build break (portibility problems with stl hash).  This partly turns off the stl improvements.

It also removes some old code that ancient compilers used to need.
However, the main issue is getting access to hash functions for
unordered_map in portable way.

9 years agoPreprocessor: 1) Rationalize the "fixed atom" scheme, 2) remove redundant lookups...
John Kessenich [Sun, 19 Jul 2015 21:49:03 +0000 (15:49 -0600)]
Preprocessor: 1) Rationalize the "fixed atom" scheme, 2) remove redundant lookups when the text is already available.

This simplification is a prelude to eliminating what I appear unnecessary
symbol inserts into tables when tokenizing in the preprecessor, which
show up as taking notable time. (Performance issue.)  It also simply makes
the preprocessor easier to understand, which it is badly in need of.

9 years agoPerformance: Simple upgrade/cleanup of stl c++11 containers (10% perf. increase).
John Kessenich [Sun, 19 Jul 2015 04:34:27 +0000 (22:34 -0600)]
Performance: Simple upgrade/cleanup of stl c++11 containers (10% perf. increase).

9 years agoBuilding: Fix a couple of new warnings.
John Kessenich [Sat, 18 Jul 2015 17:25:54 +0000 (11:25 -0600)]
Building: Fix a couple of new warnings.

9 years agoFront-end: Add error-recovery code for a switch statement that ends with a case/defau...
John Kessenich [Sat, 18 Jul 2015 17:13:14 +0000 (11:13 -0600)]
Front-end: Add error-recovery code for a switch statement that ends with a case/default that has no statements.

9 years agoGenerate correctly structured do-while loops.
David Neto [Wed, 15 Jul 2015 20:21:26 +0000 (16:21 -0400)]
Generate correctly structured do-while loops.

The loop test is always emitted before the loop body.

For do-while loops, use a phi node to track whether we're
on the first loop iteration, and only check the loop test
on the second and subsequent iterations.

For do-while loops, the loop test branch no longer occurs
at the top of the loop, so it must get its own selection
merge instruction.

A block can't be the target of more than one merge instruction.
So when the loop test executes after the body (as in do-while in GLSL)
we need to introduce a dummy block to be the target of the selection
merge just before the loop test conditional branch.

The other arm of the branch exits the loop and hence is the
"break block" exception in the structured control flow rules.

9 years agoMerge pull request #21 from google/allow_non_null_strings
John Kessenich [Fri, 17 Jul 2015 17:51:56 +0000 (11:51 -0600)]
Merge pull request #21 from google/allow_non_null_strings

Added a setStringsWithLengths() method to TShader.

9 years agoMerge pull request #20 from google/remove_exception
John Kessenich [Fri, 17 Jul 2015 17:45:31 +0000 (11:45 -0600)]
Merge pull request #20 from google/remove_exception

Removed the single usage of exceptions in all of glslang.

9 years agoAdded a setStringsWithLengths() method to TShader.
Andrew Woloszyn [Thu, 16 Jul 2015 13:48:47 +0000 (09:48 -0400)]
Added a setStringsWithLengths() method to TShader.

This allows us to pass through non null-terminated strings.

9 years agoRemoved the single usage of exceptions in all of glslang.
Andrew Woloszyn [Fri, 10 Jul 2015 20:11:00 +0000 (16:11 -0400)]
Removed the single usage of exceptions in all of glslang.

9 years agoFront-end: Implement GL_OES_gpu_shader5.
John Kessenich [Thu, 16 Jul 2015 01:42:59 +0000 (19:42 -0600)]
Front-end: Implement GL_OES_gpu_shader5.

9 years agoMerge pull request #18 from srk-lunarg/v30_static_analysis_fixes
John Kessenich [Wed, 15 Jul 2015 21:06:39 +0000 (15:06 -0600)]
Merge pull request #18 from srk-lunarg/v30_static_analysis_fixes

Comment out some dead assignments per suggestion from static analysis…

9 years agoComment out some dead assignments per suggestion from static analysis tools.
Steve [Wed, 15 Jul 2015 20:34:35 +0000 (14:34 -0600)]
Comment out some dead assignments per suggestion from static analysis tools.
Code is left in as comments for clarity to humans.

9 years agoMerge pull request #17 from google/non-existing-string
John Kessenich [Wed, 15 Jul 2015 20:03:33 +0000 (14:03 -0600)]
Merge pull request #17 from google/non-existing-string

Protect location setting methods from writing to non-existing strings.

9 years agoProtect location setting methods from writing to non-existing strings.
Lei Zhang [Fri, 10 Jul 2015 15:18:47 +0000 (11:18 -0400)]
Protect location setting methods from writing to non-existing strings.

TInputScanner advances its internal indices to the next character at
the end of get(), which means, after reading in the last character
in the user-provided shader string, internal index (currentSource)
will point to the next shader string (currentSource == numSources),
which doesn't exist. Then if a location setting method is called,
we will write to some out-of-bound memory.

A test case for this is "#line 10000\n". The eval() method in CPPline()
will evaluate 10000, but at the same time it reads in the next
token, '\n', and the currentSource will be numSources in TInputScanner.
Then a parseContext.setCurrentLine() is called, we are writing to
out-of-bound memory. Another test case will be "#line 10000 0\n".

9 years agoInclude specification revision as part of the version string.
John Kessenich [Wed, 15 Jul 2015 16:03:39 +0000 (10:03 -0600)]
Include specification revision as part of the version string.

9 years agoMerge pull request #16 from google/pp-directive
John Kessenich [Wed, 15 Jul 2015 01:36:29 +0000 (19:36 -0600)]
Merge pull request #16 from google/pp-directive

Preprocessing directive handling

9 years agoFront-end: enforce qualifiers that cannot appear on block declarations.
John Kessenich [Wed, 15 Jul 2015 01:30:11 +0000 (19:30 -0600)]
Front-end: enforce qualifiers that cannot appear on block declarations.

Also seems to pick up some white-space (line-ending) test differences with a
prevoius checkin.

9 years agoFix compile errors: about 25 .PpError didn't compile, need to be .ppError.
John Kessenich [Tue, 14 Jul 2015 21:33:38 +0000 (15:33 -0600)]
Fix compile errors: about 25 .PpError didn't compile, need to be .ppError.

9 years agoMerge pull request #15 from google/preprocessing-error
John Kessenich [Tue, 14 Jul 2015 21:29:13 +0000 (15:29 -0600)]
Merge pull request #15 from google/preprocessing-error

Added error output to the preprocessor.

This patch distinguishes preprocessing errors with normal parsing
errors and gives glslangValidator the ability to output preprocessing
errors.

9 years agoAdded error output to the preprocessor.
Andrew Woloszyn [Wed, 24 Jun 2015 21:00:46 +0000 (17:00 -0400)]
Added error output to the preprocessor.

This patch distinguishes preprocessing errors with normal parsing
errors and gives glslangValidator the ability to output preprocessing
errors.

9 years agoRemove uncessary line break.
Lei Zhang [Fri, 3 Jul 2015 05:35:26 +0000 (01:35 -0400)]
Remove uncessary line break.

We output empty lines before processing non-whitespace tokens,
not after done processing them.

9 years agoFix empty line handling in line directive callback.
Lei Zhang [Sun, 5 Jul 2015 02:30:59 +0000 (22:30 -0400)]
Fix empty line handling in line directive callback.

The current line number for the #line directive should be passed
in as parameter to the line directive callback. Without it, we
don't know how many empty lines we should output.

9 years agoFix line number handling in line directive callback.
Lei Zhang [Fri, 3 Jul 2015 05:25:47 +0000 (01:25 -0400)]
Fix line number handling in line directive callback.

The line argument passed into the lineCallback function is the
literal value of the first argument of the #line directive.
lastLine in DoPreprocessing() should be updated taking into
consideration the different definitions for #line between specs.

Add a test to reveal the bug.

9 years agoMerge pull request #14 from google/extensionturnedon
John Kessenich [Tue, 14 Jul 2015 18:30:26 +0000 (12:30 -0600)]
Merge pull request #14 from google/extensionturnedon

Simplify function calls for extensionsTurnedOn().

Lots of places in the code use extensionsTurnedOn(1, ...). This
patch introduces a new method, extensionTurnedOn(), for testing
if a single extension is turned on.

9 years agoMerge pull request #11 from baldurk/size-t-int-warning-fixes
John Kessenich [Tue, 14 Jul 2015 18:25:55 +0000 (12:25 -0600)]
Merge pull request #11 from baldurk/size-t-int-warning-fixes

Fix warnings compiling on x64 with size_t to int casts

9 years agoSimplify function calls for extensionsTurnedOn().
Lei Zhang [Sun, 5 Jul 2015 21:48:53 +0000 (17:48 -0400)]
Simplify function calls for extensionsTurnedOn().

Lots of places in the code use extensionsTurnedOn(1, ...). This
patch introduces a new method, extensionTurnedOn(), for testing
if a single extension is turned on.

9 years agoUpdate readme to point to Khronos landing page.
John Kessenich [Mon, 13 Jul 2015 17:41:06 +0000 (11:41 -0600)]
Update readme to point to Khronos landing page.

9 years agoFix incorrect used of snprintf()
John Kessenich [Mon, 13 Jul 2015 01:39:51 +0000 (19:39 -0600)]
Fix incorrect used of snprintf()

9 years agoUpdated command-line options, adding -o for saving binaries, -G for OpenGL SPIR-V...
John Kessenich [Mon, 13 Jul 2015 01:28:10 +0000 (19:28 -0600)]
Updated command-line options, adding -o for saving binaries, -G for OpenGL SPIR-V validation, -v etc.

Old uses should still work as they did before.
Also encapsulated use of these flags during parsing, for the parse context.
Added SPIR-V version to -v.

9 years agoon x64, size_t is 64-bit and int is 32-bit, so needs an explicit cast
baldurk [Sun, 12 Jul 2015 09:32:58 +0000 (11:32 +0200)]
on x64, size_t is 64-bit and int is 32-bit, so needs an explicit cast

9 years agoFix clang static analyzer issues, as reported by floooh.
John Kessenich [Sun, 12 Jul 2015 00:01:03 +0000 (18:01 -0600)]
Fix clang static analyzer issues, as reported by floooh.

9 years agoMerge pull request #4 from baldurk/relative-include-paths
John Kessenich [Sat, 11 Jul 2015 22:41:38 +0000 (16:41 -0600)]
Merge pull request #4 from baldurk/relative-include-paths

include by relative path, so root doesn't need to be in the search path

9 years agoMerge pull request #5 from floooh/fix-clang-warnings
John Kessenich [Sat, 11 Jul 2015 22:36:08 +0000 (16:36 -0600)]
Merge pull request #5 from floooh/fix-clang-warnings

Fix for most Xcode/clang warnings on OSX

9 years agoAdd some missing 'const' and texture-op guards, for future change to enum-based textu...
John Kessenich [Sat, 11 Jul 2015 19:37:02 +0000 (13:37 -0600)]
Add some missing 'const' and texture-op guards, for future change to enum-based texture calls.

The infrastructure is in place to not do text comparisons for "texture" ... for deducing type of
texture call.  But, it is not yet turned on, as it could break some consumers.  Am soliciting
any feedback on that.

See in Initialize.cpp: const bool PureOperatorBuiltins = false;  // could break backward compatibility; pending feedback

9 years agoFix most clang warnings
Andre Weissflog [Sat, 11 Jul 2015 12:45:57 +0000 (14:45 +0200)]
Fix most clang warnings

- member initializing order in some constructors
- missing default branches in switch-case
- uninitialized variable if switch-case default (uncritical because
  program would exit)
- && and || brace warnings in if()