1920 Commits

Author SHA1 Message Date
qining
5bec2b5619 integer type operation should not be noContraction 2016-05-09 10:46:40 -04:00
qining
34d257184a simplified the symbol definition collector code, add assert() 2016-05-09 10:46:40 -04:00
qining
0c96db5a4c add a test for matrix, fix a variable name 2016-05-09 10:46:40 -04:00
qining
25262b3fd9 Resolve comments
1. Sink adding noContraction decoration to createBinaryOperation() and
createUnaryOperation().

2. Fix comments.

3. Remove the #define of my delimiter, use global constant char.
2016-05-09 10:46:40 -04:00
qining
015150e4b3 Removed the redundant functionalities in the assignee checking traverser 2016-05-09 10:46:40 -04:00
qining
1a0d93f416 Fix the test of precise output function parameter
Rebase to 5cc344d8ce09a6d35ff88b9ea9f351062d779081 and update the
expected test result.
2016-05-09 10:46:40 -04:00
qining
9220dbb078 Precise and noContraction propagation
Reimplement the whole workflow to make that: precise'ness of struct
    members won't spread to other non-precise members of the same struct
    instance.

    Approach:
    1. Build the map from symbols to their defining nodes. And for each
    object node (StructIndex, DirectIndex, Symbol nodes, etc), generates an
    accesschain path. Different AST nodes that indicating a same object
    should have the same accesschain path.

    2. Along the building phase in step 1, collect the initial set of
    'precise' (AST qualifier: 'noContraction') objects' accesschain paths.

    3. Start with the initial set of 'precise' accesschain paths, use it as
    a worklist, do as the following steps until the worklist is empty:

        1) Pop an accesschain path from worklist.
        2) Get the symbol part from the accesschain path.
        3) Find the defining nodes of that symbol.
        4) For each defining node, check whether it is defining a 'precise'
        object, or its assignee has nested 'precise' object. Get the
        incremental path from assignee to its nested 'precise' object (if
        any).
        5) Traverse the right side of the defining node, obtain the
        accesschain paths of the corresponding involved 'precise' objects.
        Update the worklist with those new objects' accesschain paths.
        Label involved operations with 'noContraction'.

    In each step, whenever we find the parent object of an nested object is
    'precise' (has 'noContraction' qualifier), we let the nested object
    inherit the 'precise'ness from its parent object.
2016-05-09 10:46:40 -04:00
John Kessenich
d3d3ce7160 Comments only. 2016-05-06 13:06:11 -06:00
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