Commit Graph

1206 Commits

Author SHA1 Message Date
scygan
8add151c4b SPIR-V do not decorate: members of plain structs with location; non-top level members with interp.
This fixes some vulkanCTS tests that use struct arrays as a member of in/out interface blocks.

From Vulkan spec:
"If it is a not a Block, then the structure type must have a Location decoration. Its members are assigned consecutive locations in their declaration order, with the first member assigned to the location specified for the structure type. >>>>> The members, and their nested types, must not themselves have Location decorations <<<<"

From SPIR-V spec:
"When applied to structure-type members, the Decorations Noperspective, Flat, Patch, Centroid, and Sample can only be applied to the top-level members of the structure type. (Nested objects' types cannot be structures whose members are decorated with these decorations.)"
2016-05-06 16:54:54 +02:00
John Kessenich
3bdf24267c README: Editorial update. 2016-05-06 00:08:03 -06:00
John Kessenich
91cef52f63 SPV: Non-functional: modularize createInvocationsOperation() from the previous commit. 2016-05-05 16:45:40 -06:00
John Kessenich
213d4be142 Merge branch 'amdrexu-feature2' 2016-05-05 16:33:04 -06:00
John Kessenich
baa9fa5df7 Merge branch 'feature2' of https://github.com/amdrexu/glslang into amdrexu-feature2 2016-05-05 16:32:39 -06:00
John Kessenich
e2d06dbf60 Merge pull request #268 from AWoloszyn/update-cmake
CMake: Updated to better organize folders and options.
2016-05-05 13:46:36 -06:00
John Kessenich
5cc344d8ce Front-End: precise: capture noContraction on output parameter declarations. 2016-05-05 13:36:55 -06:00
John Kessenich
076879d61c Merge pull request #266 from dekimir/kfixstoll
Use strtoll, as stoll is unavailable on Android.
2016-05-05 12:59:56 -06:00
Andrew Woloszyn
0b887d00e0 Install the test executable alongside glslangValidator 2016-05-05 14:58:26 -04:00
Andrew Woloszyn
db0eaf9887 Updated cmake to better organize folders and options.
This adds solution folders that properly group gtest/glslang/hlsl.
This also marks gtest options as advanced so they don't show up
in cmake-gui by default.
2016-05-05 14:45:53 -04:00
John Kessenich
0a0db9e411 Merge branch 'amdrexu-feature' 2016-05-05 12:05:06 -06:00
John Kessenich
c8a5676025 Merge branch 'feature' of https://github.com/amdrexu/glslang into amdrexu-feature 2016-05-05 12:04:22 -06:00
Dejan Mircevski
a25352eb4f Use strtoll, as stoll is unavailable on Android. 2016-05-05 13:46:51 -04:00
John Kessenich
6dea76add2 Merge pull request #257 from antiagainst/ostrstream
Avoid printing to stdout directly in library functions.
2016-05-05 11:23:58 -06:00
John Kessenich
0542ac8f23 Merge pull request #261 from antiagainst/make-tests-clear
README: Explain test organization and deduplication.
2016-05-05 10:27:25 -06:00
Lei Zhang
d7b552a907 Improve README steps for building and testing glslang. 2016-05-05 10:50:09 -04:00
Lei Zhang
f5e33b0bac Explain organization and build steps for source code and tests. 2016-05-05 10:19:12 -04:00
Lei Zhang
17535f7d55 Create a new logger class for all messages w.r.t. SPIR-V build. 2016-05-05 10:15:06 -04:00
Lei Zhang
09caf12bec Avoid printing to stdout directly in library functions.
Previously GlslangToSpv() reported missing/TBD functionalities
by directly writing to stdout using printf. That could cause
problems to callers of GlslangToSpv(). This patch cleans up
the error reporting logic in GlslangToSpv(), TGlslangToSpvTraverser,
and spv::Builder a little bit to use ostringstream.

Also fixed the usage of GlslangToSpv() in GTest fixtures to
capture warnings/errors reported when translating AST to SPIR-V.
2016-05-05 10:15:06 -04:00
Rex Xu
338b185a2b Implement the extension GL_ARB_shader_group_vote. 2016-05-05 20:38:33 +08:00
Rex Xu
574ab04caa Implement the extension GL_ARB_shader_ballot
Add new built-in variables and functions to the parser (SPIR-V tokens are missing).
2016-05-05 19:02:35 +08:00
John Kessenich
97f4e0fe19 Merge pull request #263 from antiagainst/cmake-minimum-required
CMake: Remove duplicated cmake_minimum_required() calls.
2016-05-04 15:35:36 -06:00
Lei Zhang
3f460532cc Remove duplicated cmake_minimum_required() calls. 2016-05-04 17:01:36 -04:00
John Kessenich
3c1e08057e Front-end precise: Propagate noContraction up the AST when dereferencing structs.
This should be the last commit in this sequence to form the base of the work
in pull request #222.
2016-05-04 13:29:21 -06:00
John Kessenich
17f0786418 Parser: Precise: Recognize 'precise', tag types, and do related semantic checking.
This partly overlaps pull request #222, we have divided the work on this one.
2016-05-04 12:54:56 -06:00
John Kessenich
758bb5520d Bison: Non-functional: Move to revision 3.0.4.
This hopefully prevents obsucuring actual changes in a future commit.

Also, adds a script to update the grammar.
2016-05-04 12:54:56 -06:00
John Kessenich
952c2a0539 Merge pull request #262 from antiagainst/remove-obselete-src
Remove the obselete and incorrect LinusDoAll.bash.
2016-05-04 12:54:41 -06:00
Lei Zhang
d145f855cf Remove the obselete and incorrect LinusDoAll.bash. 2016-05-04 14:53:34 -04:00
John Kessenich
a65556918f Merge pull request #260 from antiagainst/cmake-version
CMake: Bump minimum required CMake version to 2.8.12.
2016-05-04 12:48:17 -06:00
Lei Zhang
045e02af75 Bump minimum required CMake version to 2.8.12.
CMake 2.8.12 added support for target_include_directories(), among
other features, and we would like to use it.
2016-05-04 13:06:15 -04:00
John Kessenich
52e1db879f Merge pull request #258 from antiagainst/travis
Testing: Add configuration for Travis to test on Linux and Mac OS X.
2016-05-04 10:27:53 -06:00
Lei Zhang
c4ebb55347 Add configuration for Travis to test on Linux and Mac OS X. 2016-05-04 11:55:10 -04:00
John Kessenich
34fb036a9c HLSL: Add (almost) full expression grammar: Binary, unary (pre/post-fix), assign, ... 2016-05-03 23:33:00 -06:00
John Kessenich
9c86c6ab5b HLSL: Separate out token stream handling from grammar recognition. 2016-05-03 22:49:24 -06:00
John Kessenich
e512cd943e Vulkan: Add the #define VULKAN 100 when compiled for Vulkan.
Note this requires test-based piecing together of the preamble string,
so it changed to being a std::string to make it easier to do.

This closes issue #254.
2016-05-03 21:18:59 -06:00
John Kessenich
af459216a1 Correct precision qualification on built-in functions.
This is a replacement commit for pull request #238.

This is a design change, followed by implementation change that
A) fixes the changes caused by the design change, and
B) fixes some cases that were originally incorrect.

The design change is to not give built-in functions default precision qualification.
This is to allow the rule that the precision of some built-in functions adopt their
precision qualification from the calling arguments.  This is A above.

A consequence of this design change is that all built-ins that are supposed to have
an explicit precision qualifier must now be declared that way.  So, a lot more
built-in declarations now have precision qualifiers, just to keep things the same.
This is B above.
2016-05-03 19:34:00 -06:00
John Kessenich
f88a5c756e Merge pull request #256 from DavidYen/missing_license
Remove unused files SetupLinux.sh and index.php.
2016-05-02 14:50:57 -06:00
David Yen
f67f91254b Removed unused files SetupLinux.sh, index.php. 2016-05-02 13:03:31 -07:00
John Kessenich
19f3f4724d Merge pull request #248 from amdrexu/feature2
Full stack: Implement the extension GL_ARB_gpu_shader_int64
2016-04-30 04:19:59 -06:00
Rex Xu
8ff43de891 Implement the extension GL_ARB_gpu_shader_int64
- Add new keyword int64_t/uint64_t/i64vec/u64vec.
- Support 64-bit integer literals (dec/hex/oct).
- Support built-in operators for 64-bit integer type.
- Add implicit and explicit type conversion for 64-bit integer type.
- Add new built-in functions defined in this extension.
2016-04-30 13:34:34 +08:00
David Yen
00422441ea Added missing headers to SetupLinux.sh and index.php.
Some license information were missing for some of the files, I have
added the proper licensing information as well as author information
for both files.
2016-04-29 10:38:52 -07:00
John Kessenich
010e93fe62 Merge pull request #228 from Qining/fix-infinite-loop-due-to-eof-missing
Scanner/PP: Fix the infinite loop when an input file lacks EOF
2016-04-28 12:27:47 -06:00
qining
94a89d51f3 add .err file for eof_missing test 2016-04-27 10:22:22 -04:00
qining
19647a32b9 Fix the infinite loop when an input file lacks EOF
The input scanner can be trapped in an infinite loop if the given input
file does not have EOF (and is not ended with a 'whitespace').

The problem is caused by unget(), which keeps rolling back the scanner
pointer without hitting an EOF at the end of the file. This makes getch()
function keep returning the last character of the file and never ends,
and the effect of advance() is always counteracted by unget().
2016-04-27 10:05:57 -04:00
John Kessenich
ba00f67d2f Merge pull request #251 from amdrexu/bugfix
SPV: Use OpLogicalEqual/OpLogicalNotEqual for boolean type comparison.
2016-04-27 03:50:05 -06:00
Rex Xu
c7d3656dde SPV: Use OpLogicalEqual/OpLogicalNotEqual for boolean type comparison. 2016-04-27 08:15:37 +08:00
John Kessenich
d6abcee1fc Merge pull request #247 from dneto0/no-mutex
Remove use of std::mutex in gtest code.
2016-04-22 13:38:16 -06:00
David Neto
10223e886c Remove use of std::mutex in gtest code.
Gtest runs in single-threaded mode.  So the GlslangInitializer
object in the test code doesn't have to do its own synchronization.
2016-04-21 15:56:33 -04:00
John Kessenich
63b280bbbd Merge pull request #241 from Qining/fix-spec-const-construct-matrix
SPV: Spec-consts: Fix constructors matrix and vector
2016-04-18 11:23:38 -06:00
qining
1f2820a3d3 fix the problem that spec constant composite instruction being used when only front-end constants are used in the constructor 2016-04-14 18:34:27 -04:00