|
af6fc1b4
|
2017-01-26T17:45:35
|
|
Make aggregate node creation more robust
Now aggregate nodes are always built with their return type, op and
arguments set. They'll determine their qualifier and precision
automatically.
This fixes setting of gotPrecisionFromChildren in a few cases.
This will also make it easier to split TIntermAggregate further into
specialized classes if that is desired.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I1fbe0c75679c517a22d44dfc1ea160ad7a7fdfda
Reviewed-on: https://chromium-review.googlesource.com/433468
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
72d1020e
|
2017-01-19T15:58:30
|
|
Refactor function call node creation
This makes function call node creation code simpler and more type
safe. It also prepares for further simplification by removing usage of
TFunction in places where the arguments node is sufficient.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I75d9e059bb32c475487f0be24e40ac0d78012d86
Reviewed-on: https://chromium-review.googlesource.com/433217
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
8ad9e757
|
2017-01-16T19:55:20
|
|
Always store function headers in TIntermFunctionPrototype nodes
TIntermFunctionDefinition nodes now have a TIntermFunctionPrototype
child that stores the function signature, instead of having a separate
type and an aggregate child that stores the parameters.
This makes parsing functions simpler, and paves the way for further
simplifications of function parsing, like reducing conversions between
symbol table structures and AST structures.
TIntermAggregate is now only used for function calls.
BUG=angleproject:1490
TEST=angle_unittests, angle_end2end_tests
Change-Id: Ib56a77b5ef5123b142963a18499690bf37fed987
Reviewed-on: https://chromium-review.googlesource.com/427945
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
4021932f
|
2016-12-09T09:50:51
|
|
translator: Add ES3.1 multisample texture support.
Implement shader objects, [iu]sampler2DMS, textureSize(gsampler2DMS).
as well as texelFetch(gsampler2DMS,P,sample) for the glsl.
BUG=angleproject:1590
TEST=angle_unittests
TEST=angle_end2end_tests
Change-Id: I781023f7bec34ad0264af69f34bb182b50bd1fbd
Reviewed-on: https://chromium-review.googlesource.com/423175
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
4de340ac
|
2016-12-16T09:32:03
|
|
Remove extraInfo parameter from compiler diagnostic functions
This makes error messages more consistent. It was not clear what was
supposed to go to the extraInfo parameter, and previously it was
mostly being misused, resulting in poorly formatted error messages.
Sometimes the order of parameters to the diagnostic functions like
error() and warning() was wrong altogether. The diagnostics API is
simpler when there's only the "reason" and "token" parameters that
have clear meaning and that are separated by consistent punctuation
in the output.
Fixes error messages like
"redifinition interface block member"
to be grammatically reasonable like the rest of the error messages. For
other error messages, punctuation is added to make them clearer. Example:
"invalid layout qualifier location requires an argument"
is changed to
"invalid layout qualifier: location requires an argument".
Extra spaces are also removed from the beginning of error messages.
BUG=angleproject:1670
BUG=angleproject:911
TEST=angle_unittests
Change-Id: Id5fb1a1f2892fad2b796aaef47ffb07e9d79759c
Reviewed-on: https://chromium-review.googlesource.com/420789
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
b8b0122f
|
2016-11-20T23:25:53
|
|
Add compiler support for shared memory
The patch adds handling of the 'shared' qualifier in the shader
compiler.
BUG=angleproject:1442
TEST=angle_unittests
Change-Id: Iaa288026af0faf2a30e40495faa6ea1f5ff02323
Reviewed-on: https://chromium-review.googlesource.com/413200
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
d7b1ab58
|
2016-12-12T14:42:19
|
|
Fix up translator style.
Using git cl format.
BUG=angleproject:650
Change-Id: I7d3f98d2b0dcfb0a8de6c35327db74e55c28d761
Reviewed-on: https://chromium-review.googlesource.com/419059
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
049edfa2
|
2016-11-11T14:35:37
|
|
Add volatile, coherent and restrict memory qualifiers
The patch adds support for the three remaining memory qualifiers:
volatile, coherent and restrict.
BUG=angleproject:1442
TEST=angle_unittests
TEST=angle_end2end_tests
Change-Id: Ie662d304af2399468df1d976e04c38dada1e2cec
Reviewed-on: https://chromium-review.googlesource.com/385876
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
45bcc784
|
2016-11-07T13:58:48
|
|
translator: Scope all classes with "sh".
I was seeing an odd problem with our PoolAlloc conflicting with the
glslang/Vulkan TIntermNode, so the fix was to move everything to a
separate namespace.
The bison grammars are also regenerated. No functional changes.
BUG=angleproject:1576
Change-Id: I959c7afe4c092f0d458432c07b4dcee4d39513f3
Reviewed-on: https://chromium-review.googlesource.com/408267
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
0e3aee3f
|
2016-10-27T12:56:38
|
|
Check precision qualification for all declarations
Precision qualification is now checked properly also for declarations
that don't have qualifiers.
BUG=angleproject:1574
TEST=angle_unittests
Change-Id: I3d186df0763e071614c1da9a355a6f6fefdc8091
Reviewed-on: https://chromium-review.googlesource.com/403949
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
13389b66
|
2016-10-16T11:48:18
|
|
Split TIntermDeclaration from TIntermAggregate
The new class TIntermDeclaration is now used for struct, interface
block and variable declarations. TIntermDeclaration nodes do not have
a type - rather the type is stored in each child node. The types may
differ in case the declaration is a series of array declarators with
mismatching sizes.
TIntermAggregate is still used for function calls, function
prototypes, function parameter lists and invariant declarations.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I0457188f354481470855f61ac1c878fc2579b1d1
Reviewed-on: https://chromium-review.googlesource.com/400023
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
2cc85b3b
|
2016-08-05T16:22:53
|
|
Add support for images in the compiler
The patch adds support for GLSL ES 3.1 image types.
Internal format layout qualifiers for images are added.
Support for the readonly and writeonly qualifiers are added. The other
memory qualifiers are omitted as to make the patch simpler.
Tests are added which check for correct and incorrect usage of images,
internal format layout and memory qualifiers.
BUG=angleproject:1442
TEST=angle_unittests
TEST=angle_end2end_tests
Change-Id: Ie4d3acb2a195de11b405ad54110a04c4c1de0b7e
Reviewed-on: https://chromium-review.googlesource.com/378855
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
476197f9
|
2016-10-11T13:59:08
|
|
Clean up TSymbol initialization
Now TSymbol objects always get their id when they are constructed. The
id cannot be changed after the TSymbol is created.
This makes it simpler to insert both mangled and unmangled versions of
a function to the symbol table. These can now both share the same
TSymbol object, unlike before, when inserting the same symbol twice
would have changed its symbol id.
This requires changes to function definition parsing: function
definition nodes now share any symbol created by previous prototype
declarations of the function. The parameters on the symbol get set to
the parameters in the function definition header.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I8e600e9b5e5de27d64b85c5042cfd23ff02abe63
Reviewed-on: https://chromium-review.googlesource.com/396838
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
6d40bbdd
|
2016-09-30T13:49:38
|
|
Split TIntermBlock from TIntermAggregate
The new TIntermBlock node class replaces TIntermAggregate nodes with
the EOpSequence op. It represents the root node of the tree which is
a list of declarations and function definitions, and any code blocks
that can be denoted by curly braces. These include function and loop
bodies, and if-else branches.
This change enables a bunch of more compile-time type checking, and
makes the AST code easier to understand and less error-prone.
The PostProcess step that used to be done to ensure that the root node
is TIntermAggregate is removed in favor of making sure that the root
node is a TIntermBlock in the glslang.y parsing code.
Intermediate output formatting is improved to print the EOpNull error
in a clearer way.
After this patch, TIntermAggregate is still used for function
definitions, function prototypes, function parameter lists, function
calls, variable and invariant declarations and the comma (sequence)
operator.
BUG=angleproject:1490
TEST=angle_unittests, angle_end2end_tests
Change-Id: I04044affff979a11577bc1fe75d747e538b799c8
Reviewed-on: https://chromium-review.googlesource.com/393726
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
32db19b7
|
2016-10-04T14:43:16
|
|
Ensure that if-else branches are always sequence nodes
This mainly affects RewriteElseBlocks, which was the only piece of
code still adding TIntermIfElse nodes directly as children of other
TIntermIfElse nodes.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I5b25c2fb9c642424417cd6c29e37c20482c6ffaf
Reviewed-on: https://chromium-review.googlesource.com/392847
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
5796127e
|
2016-09-14T13:57:46
|
|
Rename TIntermSelection to TIntermIfElse
Now that ternary nodes are not represented by TIntermSelection any
more, TIntermIfElse is an easier name to understand for newcomers to
the code.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: Ia1e04e356ab93409400245092a84533d7dfd129d
Reviewed-on: https://chromium-review.googlesource.com/385416
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
613b959d
|
2016-09-05T12:05:53
|
|
Clean up qualification order checks
Move determining whether qualification order checks are relaxed to
QualifierTypes.cpp. The ParseContext only needs to construct
TTypeQualifierBuilder with the shader version as a parameter, and it
will make the decision based on that. ParseContext still passes
diagnostics to the TTypeQualifierBuilder functions that return
variable qualification to make it more explicit when errors are
generated.
Also encapsulate looking for symbols in the AST inside
compiler_test.cpp.
BUG=angleproject:1442
TEST=angle_unittests
Change-Id: I4190e6a680ace0cc0568a517e86353a95cc63c08
Reviewed-on: https://chromium-review.googlesource.com/380556
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
4a9cd800
|
2016-09-01T16:51:51
|
|
Refactor type_specifier_nonarray parsing to reduce code repetition
When type_specifier_nonarray gets parsed the scope gets saved into
TType and the code becomes repetitive. Setting of the scope is moved
to type_specifier_no_prec as it occurs less times.
BUG=angleproject:911
TEST=angle_unittests
TEST=angle_end2end_tests
Change-Id: I6da5fe7bc2d60ba2996221af71b719b818f5e9b1
Reviewed-on: https://chromium-review.googlesource.com/380535
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
70866b89
|
2016-07-22T15:27:42
|
|
Change grammar to support features from es31
The grammar has been changed so that ES31 grammar is followed more
closely. The ES31 grammar is not fully supported, only functionality
related to qualifier enumeration is added.
The ParseContext is changed so that type qualifiers can be now joined
together (i.e. like layout qualifiers). This will allow enumeration of
multiple storage qualifiers (i.e. uniform readonly coherent) which is
essential for support of ES31 features.
Some of the error checks had to be moved closer to the root of the
parse tree since some of the information about the expression might be
missing.
Unfortunately, as there is no explicit ordering imposed by the
grammar, additional checks for proper order of qualifiers had to be
added. I also included unit tests which test against malformed
shaders.
BUG=angleproject:1442
TEST=angle_end2end_tests
TEST=angle_unittests
TEST=dEQP-GLES3.functional.shaders.*precision*
TEST=dEQP-GLES3.functional.shaders.*function*
TEST=dEQP-GLES2.functional.shaders.*
Change-Id: Ib3653a1ed1bfced099a6b2cbf35a7cd480c9100d
Reviewed-on: https://chromium-review.googlesource.com/362940
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
8a17626d
|
2016-08-16T14:23:01
|
|
Refactor: Return true when checks succeed in ParseContext
Instead of returning false when a check succeeds in ParseContext,
return true. This is more intuitive and in line with conventions used
elsewhere inside ANGLE.
Also includes some minor other cleanup in ParseContext, like improved
variable names and code structure especially when checking array
element properties. This will make introducing arrays of arrays easier
in the future.
BUG=angleproject:911
TEST=angle_unittests
Change-Id: I68233c01ccfbfef9529341af588f615efc2b503a
Reviewed-on: https://chromium-review.googlesource.com/371238
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
856c497e
|
2016-08-08T11:38:39
|
|
Clarify error checking function names in the GLSL parser
Most error checking functions in ParseContext used to follow a format
like <property>ErrorCheck. Sometimes this function would check that
the node/value would have <property>, sometimes it would check that
the node/value would not have it, which was confusing. Change most of
these functions to use a lot more descriptive names, which clearly
communicate what they are checking for.
Also includes a bit of refactoring in constructorErrorCheck(), so that
the function only checks for errors rather than also setting the type
of the constructor node.
Also make TType::arraySize unsigned, and return a sanitized size from
checkIsValidArraySize() instead of using an output parameter.
BUG=angleproject:911
TEST=angle_unittests
Change-Id: Id9767b8c79594ad3f782f801ea68eb96df721a31
Reviewed-on: https://chromium-review.googlesource.com/367070
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
383b791a
|
2016-08-05T11:22:59
|
|
Remove recover() from ParseContext
This call is a no-op. The shader parser is intended to almost always
recover from errors, so including it doesn't clarify the code either.
It's simpler to remove it entirely.
BUG=angleproject:911
TEST=angle_unittests
Change-Id: I0feae097c2807c8e9559672e7a3d50a2fc4fbdea
Reviewed-on: https://chromium-review.googlesource.com/367040
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
802abe01
|
2016-08-04T17:48:32
|
|
Add compute shader compilation support in the glsl compiler
Support is added for compute shader compilation. There is a small
extension to the parser so that 'local_size_x = ', 'local_size_y = '
and 'local_size_z = ' are supported as layout qualifiers.
A few shader compilation tests are added and one which checks the AST
whether the layout qualifiers are properly parsed.
BUG=angleproject:1442
TEST=angle_unittests
TEST=angle_end2end_tests
Change-Id: I67283797d1cf13fa4ac47faa2a6e66d93a2db867
Reviewed-on: https://chromium-review.googlesource.com/362300
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
1be913cf
|
2016-07-11T17:59:16
|
|
Add support for ES31 context creation
The dEQP test for context creation passes.
SH_WEBGL3_SPEC has been added, but it should be considered whether we
should keep it, remove it or rename it. It was added so that there is
a webgl mapping to es 310 shaders. Check Compiler.cpp. The bison file
has been modified so that some tokens from es3 can be also used in
es31 as well.
A separate macro ES3_1_ONLY is added so that some tokens are limited
only for es 310 shaders.
BUG=angleproject:1442
TEST=angle_unittests
Change-Id: I2e5ca227c96046c30dc796ab934f3fda9c533eba
Reviewed-on: https://chromium-review.googlesource.com/360300
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
9de84a5d
|
2016-06-14T17:36:01
|
|
Clean up parsing function headers
Move function header parsing code to ParseContext instead of having
it in the grammar file. This commit is pure refactoring. This code
needs to be changed later to detect returning arrays containing
structs.
This commit also disables clang format for glslang.cpp generated by
bison.
TEST=angle_unittests
BUG=angleproject:1015
Change-Id: If60848ca32da6b98ea8bcd95bba8c3f831634b51
Reviewed-on: https://chromium-review.googlesource.com/352480
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
bda75597
|
2016-04-18T17:25:54
|
|
Finish NV12 support via streams.
The main functionality for NV12 texture support through EGL streams has
been added. Updates to the compiler, texture code, and stream code were
added to support binding to external D3D11 NV12 textures. An end2end test
was also added to test sampling of YUV textures and converting to RGB.
There is also a new script to convert BMP files to an NV12 texture ready
to load into D3D11 for testing purposes.
BUG=angleproject:1332
Change-Id: I39b6ec393ea338e2c843fb911acc1b36cd1158a0
Reviewed-on: https://chromium-review.googlesource.com/339454
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Ian Ewell <ewell@google.com>
Reviewed-on: https://chromium-review.googlesource.com/341254
Reviewed-by: Ian Ewell <ewell@google.com>
|
|
9670b03e
|
2016-04-29T09:47:47
|
|
Revert "Finish NV12 support via streams."
Broke Windows Clang compilation, see https://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Win%20Clang%20Builder%20%28dbg%29/builds/3583/steps/compile/logs/stdio and search for TextureStorage11.h
This reverts commit 9b8b359fa3615be7c7492239a48f61103b2e4fcc.
Change-Id: I6e54305eba02b40927a35577594df39e951adb32
Reviewed-on: https://chromium-review.googlesource.com/341430
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
|
|
9b8b359f
|
2016-04-18T17:25:54
|
|
Finish NV12 support via streams.
The main functionality for NV12 texture support through EGL streams has
been added. Updates to the compiler, texture code, and stream code were
added to support binding to external D3D11 NV12 textures. An end2end test
was also added to test sampling of YUV textures and converting to RGB.
There is also a new script to convert BMP files to an NV12 texture ready
to load into D3D11 for testing purposes.
BUG=angleproject:1332
Change-Id: I098940e6f25e113dcc4fc8d22ffed4b5a16fd860
Reviewed-on: https://chromium-review.googlesource.com/339454
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Ian Ewell <ewell@google.com>
|
|
ee63f5d9
|
2016-01-04T11:34:54
|
|
Move function parsing code to ParseContext
This change is pure refactoring. It will make it easier to fix bugs
related to function declarations.
BUG=angleproject:911
BUG=angleproject:1067
BUG=angleproject:1068
TEST=angle_unittests
Change-Id: I031783dc02612d9cf3ff7a9c8291cf8ab33577aa
Reviewed-on: https://chromium-review.googlesource.com/320081
Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
15c2ac30
|
2015-11-09T15:51:43
|
|
Fix constructor parsing issues
After this patch, ANGLE no longer accepts constructors where any of
multiple parameters is sampler or void.
Also, structure array constructors with just one parameter are now
accepted.
Error message for a constructor with no parameters is also more
informative than before.
BUG=angleproject:1193
TEST=angle_unittests
Change-Id: I6b897973448cf500096f612b3b95dcc23aebc716
Reviewed-on: https://chromium-review.googlesource.com/311590
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
0b2d2dcf
|
2015-11-04T16:35:32
|
|
Move comma operator parsing to ParseContext
This change is pure refactoring. It will help with fixing comma operator
return value qualifier bug.
BUG=angleproject:911
BUG=angleproject:1201
Change-Id: I481c337adbaf789cc959c8a1106f99ad7275e1e5
Reviewed-on: https://chromium-review.googlesource.com/311170
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
cdeafd20
|
2015-11-05T14:59:18
|
|
Fix missing init when parsing storage qualifier fails
When parsing a storage qualifier results in an error, the parser should
not leave the type uninitialized. Otherwise after recovering from the
error the parsed value could contain uninitialized memory, which could
cause flaky asserts in further parsing.
TEST=dEQP-GLES2.functional.shaders.functions.*
BUG=angleproject:1200
Change-Id: Ia3add76df243898e35fee97d01555b953cff8379
Reviewed-on: https://chromium-review.googlesource.com/311140
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
|
|
82c29ed2
|
2015-11-03T13:06:54
|
|
Move variable identifier parsing to ParseContext
This change is purely refactoring existing functionality to make it
easier to change variable identifier parsing.
BUG=angleproject:911
BUG=541551
Change-Id: I282fbb66d40cd71fa0f4804e4a8e893744cd6bfc
Reviewed-on: https://chromium-review.googlesource.com/309724
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
80ecac9e
|
2015-08-25T15:37:48
|
|
Remove unused mOptimize/mDebug flags from TIntermAggregate
These flags were written but they were never read.
TEST=compile
BUG=angleproject:1116
Change-Id: I41e3e89f13861ebda4828c76c753ca17c74c4358
Reviewed-on: https://chromium-review.googlesource.com/294931
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
185fb403
|
2015-06-12T15:48:48
|
|
Move function prototypes and declarations out of the .y
This will make the code easier to edit and maintain.
BUG=none
TEST=angle_unittests,angle_end2end_tests
Change-Id: I955307d1209170fa99142103bc4d361c9eab1cc8
Reviewed-on: https://chromium-review.googlesource.com/286145
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
abb0c381
|
2015-07-13T12:01:12
|
|
Check that layout qualifiers may only appear in declarations
In the shading language grammar, layout qualifiers may appear in loop
conditions and function declarations, but this is not valid ESSL 3.00
according to section 4.3.8.
TEST=angle_unittests, dEQP-GLES3.functional.shaders.*layout*
BUG=angleproject:1064
Change-Id: I73f805247bf6678b953f2e1d45a23391e9eacb96
Reviewed-on: https://chromium-review.googlesource.com/285040
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
01971113
|
2015-07-10T14:54:00
|
|
Cache TTypes.
*re-land with build fix for Win/Release*
This change saves us ~70KiB per compiler with just ~3KiB of cache.
BUG=492725
Change-Id: I4382c55b2480f70b00c5d117fcb7e0c51d0dfbb4
Reviewed-on: https://chromium-review.googlesource.com/284735
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Dmitry Skiba <dskiba@google.com>
Reviewed-by: Alexis Hétu <sugoi@chromium.org>
|
|
53b76107
|
2015-07-10T18:52:58
|
|
Revert "Cache TTypes."
Unused variable warning in Release:
warning C4189: 'MaxEnumValue' : local variable is initialized but not referenced
I'll handle fixing this.
BUG=492725
This reverts commit b25d14e4b39ee273fad3bb585c3a3a929b3f794c.
Change-Id: I502fc5288d5d3c48ecd43f84acdf66b7e300ad22
Reviewed-on: https://chromium-review.googlesource.com/284863
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
b25d14e4
|
2015-06-23T17:43:14
|
|
Cache TTypes.
This change saves us ~70KiB per compiler with just ~3KiB of cache.
BUG=492725
Change-Id: I7b8053c032c9c68f646162baf61abf6db3afe52e
Reviewed-on: https://chromium-review.googlesource.com/284003
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
2f232370
|
2015-07-07T21:57:55
|
|
Revert "Cache TTypes."
Lots of compile errors.
BUG=492725
This reverts commit 5377720aae042c5bfae0e8a37032c90dc3ab78cf.
Change-Id: I64889b99b1f1f48d39b87ebb668f6a32a3abac45
Reviewed-on: https://chromium-review.googlesource.com/283945
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
5377720a
|
2015-06-23T17:43:14
|
|
Cache TTypes.
This change saves us ~70KiB per compiler with just ~3KiB of cache.
BUG=492725
Change-Id: I2ee748f7271b1afe0834083cbff6f0b84104aa53
Reviewed-on: https://chromium-review.googlesource.com/281411
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Dmitry Skiba <dskiba@google.com>
|
|
7f17a50c
|
2015-06-22T15:08:39
|
|
Store TFunction::returnType by a const pointer.
On 32-bit Android this change saves ~30KiB per compiler instance.
BUG=492725
Change-Id: I8bea48d57ee7eac0a0ee417035085c0d335aea09
Reviewed-on: https://chromium-review.googlesource.com/281047
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Dmitry Skiba <dskiba@google.com>
|
|
efa3d8eb
|
2015-06-22T14:52:10
|
|
Change TSymbolTable::insertBuiltIn() TType* pointers to const.
Const types make it possible to implement caching and
other optimizations.
BUG=492725
Change-Id: I64398bb9effcc909dd052a038acbb5ec0ca730e8
Reviewed-on: https://chromium-review.googlesource.com/281046
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Dmitry Skiba <dskiba@google.com>
|
|
6e06b1f4
|
2015-05-14T10:01:17
|
|
Make TParseContext a class, with private data.
*re-land with build fix*
BUG=angleproject:995
Change-Id: I67d3ded8f6c705b54fb372857e07ce1a86b58475
Reviewed-on: https://chromium-review.googlesource.com/271162
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
749fe340
|
2015-05-13T21:07:55
|
|
Revert "Make TParseContext a class, with private data."
Causing build errors on Linux:
FAILED: ninja -t msvc -e environment.x86 -- C:\b\build\goma/gomacc "C:\b\depot_tools\win_toolchain\vs2013_files\VC\bin\amd64_x86\cl.exe" /nologo /showIncludes /FC @obj\third_party\angle\src\compiler\translator\translator_lib.ParseContext.obj.rsp /c ..\..\third_party\angle\src\compiler\translator\ParseContext.cpp /Foobj\third_party\angle\src\compiler\translator\translator_lib.ParseContext.obj /Fdobj\third_party\angle\src\translator_lib.cc.pdb
c:\b\build\slave\gpu_win_builder__dbg_\build\src\third_party\angle\src\compiler\translator\validateglobalinitializer.h(11) : error C2220: warning treated as error - no 'object' file generated
c:\b\build\slave\gpu_win_builder__dbg_\build\src\third_party\angle\src\compiler\translator\validateglobalinitializer.h(11) : warning C4099: 'TParseContext' : type name first seen using 'class' now seen using 'struct'
c:\b\build\slave\gpu_win_builder__dbg_\build\src\third_party\angle\src\compiler\translator\parsecontext.h(28) : see declaration of 'TParseContext'
BUG=angleproject:995
This reverts commit 6c0c2987fba9dcf2a8d432534c9548092281bfa4.
Change-Id: I49a8b7df9bc8b7c4892bf3af5e2c7a6444fba890
Reviewed-on: https://chromium-review.googlesource.com/270767
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
6c0c2987
|
2015-05-13T13:50:04
|
|
Make TParseContext a class, with private data.
BUG=angleproject:995
Change-Id: Ie077e3a4f0fd5ef840aa35edeb41d15a98b7c0ff
Reviewed-on: https://chromium-review.googlesource.com/270628
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
37ad4744
|
2015-04-27T13:18:50
|
|
Add support for parsing ESSL3 invariant qualifiers
The parser recognizes ESSL3 invariant variable declaration syntax and
marks the variables as invariant.
In ESSL3, invariant out variables can be linked to non-invariant
in variables, so linking checks should now be different depending on
shading language version. A shading language version dependent varying
matching check is added to the translator API to facilitate this.
Tested by deqp/data/gles3/shaders/qualification_order.html after patching
Chrome to use the new linking check API.
A previous revision of this change that broke API compatibility was
reverted since it broke Chromium FYI bots. This revision keeps deprecated
API functionality around for now so that changes can be rolled
step-by-step to Chromium without breakage.
TEST=WebGL 2 conformance tests, angle_unittests
BUG=angleproject:987
Change-Id: Iecb64e3afd23e267ba999bc17f44390affcdfc13
Reviewed-on: https://chromium-review.googlesource.com/269940
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
9e64edce
|
2015-05-07T14:08:06
|
|
Revert "Add support for parsing ESSL3 invariant qualifiers"
Build breaks in GPU FYI bots.
BUG=angleproject:987
This reverts commit 4008879357159c7850cf105f2ae842bc68dd3c18.
Change-Id: Ia88ad302c403c65516c050eb7741316b5097bcfb
Reviewed-on: https://chromium-review.googlesource.com/269847
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
40088793
|
2015-04-27T13:18:50
|
|
Add support for parsing ESSL3 invariant qualifiers
The parser recognizes ESSL3 invariant variable declaration syntax and
marks the variables as invariant.
In ESSL3, invariant out variables can be linked to non-invariant
in variables, so linking checks should now be different depending on
shading language version. The varying matching check in the translator
API is changed to be shading language version dependent to facilitate
this.
Tested by deqp/data/gles3/shaders/qualification_order.html after patching
Chrome to use the new linking check API.
TEST=WebGL 2 conformance tests, angle_unittests
BUG=angleproject:987
Change-Id: I3982feff7380c4dfc647940ee03a020692dd0c59
Reviewed-on: https://chromium-review.googlesource.com/267663
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
214c2d8e
|
2015-04-27T14:49:13
|
|
Separate invariance from qualifiers
ESSL3 makes it possible to combine invariant with several more different
qualifiers. To avoid combinatorial explosion of the qualifier enum, track
invariance with a separate boolean.
TEST=WebGL conformance tests, angle_unittests
BUG=angleproject:987
Change-Id: I0c6629e5ca2ded06db9ac9e5bab2fb6480299a5a
Reviewed-on: https://chromium-review.googlesource.com/267662
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
6ba6eadc
|
2015-05-04T14:21:21
|
|
Rename ConstantUnion to TConstantUnion.
This clarified that we're using the Pool allocator/deallocator for
this type.
BUG=angleproject:993
Change-Id: If8c95f6054d07291e7014be0d4e35766ba2e943b
Reviewed-on: https://chromium-review.googlesource.com/269131
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
b96687df
|
2015-04-30T15:56:51
|
|
translator: Regenerate with Bison 3.0.4.
BUG=angleproject:463
Change-Id: If89a29de8fb006e8e3b0483ac5df21c8833ce974
Reviewed-on: https://chromium-review.googlesource.com/268511
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
ffe6edfd
|
2015-04-13T17:32:03
|
|
Add basic support for the length() method of arrays
Support expressions where the expression that .length() is called on
does not have side effects.
Tested with WebGL 2 test sdk/tests/deqp/data/gles3/shaders/arrays.html
TEST=WebGL 2 conformance tests
BUG=angleproject:972
Change-Id: Ib4f8377a51da61179b6e47fbcf6b4d915e351fbd
Reviewed-on: https://chromium-review.googlesource.com/265654
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
5290174b
|
2015-04-15T13:42:45
|
|
Refactor ternary operator parsing
Refactor ternary operator parsing so that validation is done in
ParseContext and Intermediate's role is simply to create the node added
to the tree.
Remove partially bugged checks for null nodes as a part of this - in
error cases the parser doesn't typically add null nodes to the tree, but
rather always has a fallback to add a dummy node if parsing fails as a
method of recovery. When parsing ternary operators it should be
guaranteed that none of the parameter nodes is null.
Includes a better explanation of why ternary operators are not always
folded when only the condition is constant, and a test to make sure this
doesn't regress.
BUG=angleproject:952
TEST=WebGL conformance tests, angle_unittests
Change-Id: Icbcb721b5ab36cf314a16e79f9814aef1f355fa0
Reviewed-on: https://chromium-review.googlesource.com/265643
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
376f1b5d
|
2015-04-13T13:23:41
|
|
Add support for implicit array size
ESSL3 introduces implicit array size that is determined automatically
according to the initializer. Implicit sizes are resolved when parsing
constructors and when initializers are evaluated, so ANGLE's AST will not
contain implicit sizes.
Declarations where there are two differently sized arrays with the same
implicitly sized type, for example:
float[] a = float[](0.0), b = float[](0.0, 1.0);
will be transformed into declarations where the two arrays don't share
the array size like this:
float a[1] = float[1](0.0), float b[2] = float[2](0.0, 1.0);
so they are not a problem.
Unlike sized arrays, implicitly sized arrays don't have a size limit
enforced by the parser.
Include a test that verifies that non-initialization of an implicitly
sized array defined using ESSL3 type syntax is caught by the parser.
Additionally tested with WebGL 2 test
sdk/tests/deqp/data/gles3/shaders/arrays.html
TEST=WebGL 2 conformance tests, angle_unittests
BUG=angleproject:941
Change-Id: Ib55b7601848102a103af9db284a80f09abaeb021
Reviewed-on: https://chromium-review.googlesource.com/265653
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
3875ffd1
|
2015-04-10T16:45:14
|
|
Add parser support for initializing sized arrays
Still missing from this patch: HLSL output, implicitly sized arrays.
Tested with WebGL 2 test sdk/tests/deqp/data/gles3/shaders/arrays.html
TEST=WebGL 2 conformance tests
BUG=angleproject:941
Change-Id: I900f2af843fd8046f23dd4b77352e77026bbba84
Reviewed-on: https://chromium-review.googlesource.com/265652
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
e7847b08
|
2015-03-16T11:56:12
|
|
Unify declaration parsing code
Remove the unused identifierSymbol parameter from parseSingleDeclarator
and unify the ordering of parameters and the code style of different
declaration and declarator parsing functions. Some minor functional
changes to array size handling are done mainly to unify error message
generation. There's soon going to be more of these functions, so it's
good to be systematic.
TEST=angle_unittests, WebGL conformance tests
BUG=angleproject:941
Change-Id: I03b0220de93ca5719fdb7c1790a5999b8cb5b225
Reviewed-on: https://chromium-review.googlesource.com/265202
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
e16eae36
|
2015-04-10T11:48:55
|
|
Fix structQualifierErrorCheck calls in glslang.y
structQualifierErrorCheck is called incorrectly in glslang.y. Remove one
unnecessary call entirely and change another call to samplerErrorCheck.
This will enable further changes to merge structQualifierErrorCheck into
singleDeclarationErrorCheck.
TEST=angle_unittests
BUG=angleproject:969
Change-Id: Ib43233e275fbf4db7e5fda6df6b45a655bdee8a2
Reviewed-on: https://chromium-review.googlesource.com/265200
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
794e0009
|
2015-04-07T18:31:54
|
|
Fix and enable warning C4244 (Conversion from 'type1' to 'type2', possible loss of data)
Change-Id: Id0e06d7d6600344d858f00dabc219d79289bbc82
Reviewed-on: https://chromium-review.googlesource.com/265020
Tested-by: Minmin Gong <mgong@microsoft.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
b3584fb4
|
2015-04-09T17:34:21
|
|
Revert "Fix and enable warning C4244 (Conversion from 'type1' to 'type2', possible loss of data)"
Causing a build failure on Mac/Clang:
./Tokenizer.cpp:551:7: error: extra tokens at end of #else directive [-Werror,-Wextra-tokens]
#else if defined(_MSC_VER)
http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Mac%20Builder/builds/29136
This reverts commit 3b26e231d99154814eb428f75a67bbe7a21adadc.
Change-Id: I2d11ddcc18130d908fd2ec3d6f5ab890cfccd5e7
Reviewed-on: https://chromium-review.googlesource.com/264983
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
3b26e231
|
2015-04-07T18:31:54
|
|
Fix and enable warning C4244 (Conversion from 'type1' to 'type2', possible loss of data)
Change-Id: I73d9a2b9ad16f032be974b9c819de0dc1247c2ea
Reviewed-on: https://chromium-review.googlesource.com/264533
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
71d147f6
|
2015-02-11T11:15:24
|
|
Implemented a CallDAG to allow for more AST analysis
The CallDAG preprocesses the AST to construct a DAG of
functions that can be used for several analyses.
Use it to implement check for recursion and max call
depth. It will also be used to limit the usage of
[[flatten]] and [[unroll]].
BUG=angleproject:937
BUG=395048
Change-Id: I8578703f2d49513f315aecccbcff34914562e4ff
Reviewed-on: https://chromium-review.googlesource.com/263774
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
|
|
693c9aa0
|
2015-04-07T17:50:36
|
|
Replace setArray function in TPublicType with functions from TType
Having only one way of setting or clearing arrayness of types clarifies
code dealing with arrays.
TEST=angle_unittests
BUG=angleproject:941
Change-Id: I98cb7c44fd66440c9de8b4c6c4a02827e9300db7
Reviewed-on: https://chromium-review.googlesource.com/264361
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
93a90fd0
|
2015-04-07T18:14:07
|
|
Remove half-baked non-sized array support
ANGLE used to accept shaders with non-sized arrays in initializer lists.
Fix this. Proper support for implicitly sized arrays will be implemented
later for ESSL3.
TEST=angle_unittests
BUG=angleproject:941
Change-Id: I53c5ccf0f7ef09ad30e142f8350812959fc4846c
Reviewed-on: https://chromium-review.googlesource.com/264360
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
f40319e9
|
2015-03-10T14:33:00
|
|
Add basic support for array constructors
Add limited support for parsing array constructors and writing them out as
GLSL code.
Still missing from this version: HLSL output, array support in
initializer lists, arrays with implicit size.
BUG=angleproject:941
Change-Id: I7febf80923c4cd0b730399f1f49f9456cf3668e9
Reviewed-on: https://chromium-review.googlesource.com/260572
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
186160b2
|
2015-04-02T19:34:38
|
|
Revert "Implemented a CallDAG to allow for more AST analysis"
failures in angle_unittests and compilation failure on clang (see: https://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Mac%20Builder%20%28dbg%29/builds/30016/steps/compile/logs/stdio) .
This reverts commit b34d1d12969496b1b0fb53934b8ce3200304f900.
Change-Id: Ia995fb2db0e891294f3461de01617cb13e5ae381
Reviewed-on: https://chromium-review.googlesource.com/263727
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
|
|
b34d1d12
|
2015-02-11T11:15:24
|
|
Implemented a CallDAG to allow for more AST analysis
The CallDAG preprocesses the AST to construct a DAG of
functions that can be used for several analysis.
Use it to implement check for recursion and max call
depth. It will also be used to limit the usage of
[[flatten]] and [[unroll]].
BUG=angleproject:937
BUG=395048
Change-Id: I643e0ed605ad095e4fd7da4977d842be5e6a12e0
Reviewed-on: https://chromium-review.googlesource.com/229352
Reviewed-by: Nicolas Capens <capn@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
c8ef69d2
|
2015-03-18T16:43:22
|
|
Fix C4702 issues (unreachable code) in ANGLE, excluding <xtree>
Change-Id: Ia7603139af266fd7b14efc8c3465225738456e67
Reviewed-on: https://chromium-review.googlesource.com/261038
Tested-by: Austin Kinross <aukinros@microsoft.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
d6b14287
|
2015-03-17T14:31:35
|
|
Move binary op array check to ParseContext
Also piece together an addAssign function in ParseContext that uses the
binary op array check. This will make it easier to change the
array-related checks in the future to use shaderVersion. Moving
validation out from IntermBinary::promote also makes the architecture
clearer, promote()'s role should be mainly to determine the type of the
return value of the binary operation, not to do validation.
BUG=angleproject:941
TEST=angle_unittests, WebGL conformance tests
Change-Id: If1de33ea250893527be7f0d7930d4678a0864684
Reviewed-on: https://chromium-review.googlesource.com/260571
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
b2983c95
|
2015-03-18T14:02:46
|
|
Correctly insert unmangled function names to symbol table
This fixes detecting some cases of function parameter mismatch
(previously a mangled function name corresponding to no function
parameters was added to the symbol table for each user-defined function,
and this was returned when doing function lookups with no parameters).
Also fixes detection of reusing a function name as a variable/struct
name.
New unit tests are added to ensure that these fixes don't regress.
BUG=angleproject:936
TEST=angle_unittests, WebGL conformance tests
Change-Id: I2dadde9dcc01c7a4a653c1982c36377b89e6d437
Reviewed-on: https://chromium-review.googlesource.com/260800
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
2728eda4
|
2015-03-16T10:23:50
|
|
Revert "A special state to track field selection is not necessary."
This reverts commit f8dc4fb66d2ee473b6ba37626f02756422863f6c.
The special state to track field selection is actually necessary to avoid
reduce/reduce conflicts when array constructors are added to the grammar.
BUG=angleproject:941
TEST=WebGL conformance tests, angle_unittests
Change-Id: I55476483c9e83241e8978cd58f05ef303c7c8680
Reviewed-on: https://chromium-review.googlesource.com/260260
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
c4ba3bef
|
2015-03-02T14:42:24
|
|
Refactor addFunctionCallOrMethod out of glslang.y
TEST=angle_unittests
BUG=angle:911
Change-Id: I6d4c0f0bfbf9e6252e241ae5bb1b6acdb463fce6
Reviewed-on: https://chromium-review.googlesource.com/255451
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
53f076fa
|
2015-02-20T10:55:14
|
|
Add basic error checks for switch and case
Check that the case labels have constant scalar integers, and that switch
statements are initialized with scalar integers. Also check that case and
default labels do not exist outside switch statements. Allow break
statements inside switch statements.
Tested by manually disabling shading language version checks for switch
in a Chromium build and checking that the expected errors are generated.
BUG=angle:921
Change-Id: Ibe83d0db52958c493ded5640d4babf670dc02d55
Reviewed-on: https://chromium-review.googlesource.com/251523
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
a3a36664
|
2015-02-17T13:46:51
|
|
Implement parsing switch statements
Put in some groundwork for parsing switch statements and case labels in
the parser, including definitions for IntermNode classes. Intermediate
functions for adding the statements are stubbed to only generate errors
for now.
Tested by manually disabling shading language version checks for switch
in a Chromium build and checking that the expected errors are generated.
BUG=angle:921
Change-Id: I064b3e0c4c1b724a083cf5bc78eebfdd3794eb1b
Reviewed-on: https://chromium-review.googlesource.com/250380
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
49300865
|
2015-02-20T14:54:49
|
|
Refactor validating jump statements out of glslang.y
Move the logic to ParseContext. This will simplify changing the logic for
the break statement that is needed to implement switch.
BUG=angle:921, angle:911
TEST=WebGL conformance tests
Change-Id: Ib8bbc7075c05d345e90377202b5446fb3307f94c
Reviewed-on: https://chromium-review.googlesource.com/251522
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
b6e07a6a
|
2015-02-16T12:22:10
|
|
Implement ESSL3 modf
This is the first built-in function that has an out parameter, so l-value
checks are added for built-ins.
BUG=angle:918
Change-Id: Ifd5befe955224f706f864e25107879c9cdce9e9f
Reviewed-on: https://chromium-review.googlesource.com/250780
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
ff805cc3
|
2015-02-13T10:59:34
|
|
Separate integer and float modulus
Integer and float modulus are separated into Mod and IMod operator types
to make the code clearer and to make GetOperatorString return the correct
value for both.
Change-Id: Ibfbca2c558bf919b0eab6404d7349f87fe47a18c
Reviewed-on: https://chromium-review.googlesource.com/249692
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
09b22474
|
2015-02-11T11:47:26
|
|
Add addBinaryMath and addUnaryMath helpers to ParseContext
This refactoring reduces code duplication and moves functionality that is
not immediately related to the language grammar out of glslang.y.
BUG=angle:911
Change-Id: If5e225461890ed542dee01905829df1c9a6f5e27
Reviewed-on: https://chromium-review.googlesource.com/248570
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
31b5fc62
|
2015-01-16T12:13:36
|
|
Add support for bitwise operations in ESSL3
Add support for <<, >>, &, |, ^, and their compound assignment variants
<<=, >>=, &=, |=, ^=. Also add support for bitwise not (~).
BUG=angle:870
Change-Id: I5e6a835409589556d5d58d58078fdf505cfd8da5
Reviewed-on: https://chromium-review.googlesource.com/241850
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
d68157fc
|
2015-01-16T12:24:17
|
|
Fix issues related to modulus operator
Make sure that "scalar %= vector" is not approved by the compiler, and
that % and %= are only exposed on GLES3.
BUG=angle:854
Change-Id: I3ac7eb607bd86a6caa905d2bef5d397688ad3fd3
Reviewed-on: https://chromium-review.googlesource.com/241410
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
2aafa18b
|
2015-01-08T19:04:48
|
|
Fix null check after addUnaryMath is called for a built-in function
The intermTypedNode pointer null check should be done before the pointer
is used, not after. In practice the pointer should never be null if
IntermUnary::promote() is consistent with the built-in function table,
but it's useful to have the null check as a fail-safe when developing.
Change-Id: I24e0d7399ef9d628f474e99fbca08dbd67fdd8c3
Reviewed-on: https://chromium-review.googlesource.com/240411
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
be954a23
|
2014-12-23T00:05:28
|
|
Implement support for the binary operator '%' in the translator.
BUG=angle:854
Change-Id: If116de132dc83d93255749b54c1919a75abcb65c
Reviewed-on: https://chromium-review.googlesource.com/236330
Tested-by: Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
185de884
|
2014-12-22T15:17:52
|
|
Update ANGLE's translator to Bison 3.
BUG=angle:462
Change-Id: I2c1c18027dee1c3b4efb87374caaadbf58367841
Reviewed-on: https://chromium-review.googlesource.com/236930
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
76acee83
|
2014-11-04T13:44:03
|
|
Name mangle function prototypes and print them in interm output
This patch changes function prototype handling so that they get assigned
the same kind of a mangled name as function definitions and function
calls. This name is now also printed in interm output so that function
prototypes can be accurately identified in the interm output.
BUG=angle:821
TEST=compiler_tests
Change-Id: Ia150b8ac5b816b8096c964767cd8666bdee28539
Reviewed-on: https://chromium-review.googlesource.com/227390
Reviewed-by: Nicolas Capens <capn@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
d2a67b96
|
2014-10-21T16:42:57
|
|
Fix precision tracking for built-in function return values
Previously, the type of the return value of all function calls was set to
the type of the return value in the function signature. This did not
carry precision information.
This patch changes this so that the return value precision is set
correctly for built-in functions. For single-argument math functions, it
mostly depends on that addUnaryMath sets the type of the return value to
be the same as the type of the operand. The type is replaced but the
precision information from the operand type is retained when needed. For
multi-argument math functions, precision is determined based on all the
nodes in the aggregate after the type has been set. For texture
functions, the precision is set according the sampler type as per ESSL
1.0 spec. For textureSize, the precision is always highp as per ESSL 3.0
spec.
BUG=angle:787
Change-Id: I48448e3ffe38656b91177dee9b60dd07a03cd095
Reviewed-on: https://chromium-review.googlesource.com/224951
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
de1e00e1
|
2014-10-09T16:55:32
|
|
Implement support of unary operator "+" in translator.
BUG=angle:779
TEST=conformance/glsl/misc/struct-unary-operators.html
Change-Id: Ia827e07dcfc8ad3bbbc078e54336815be9027945
Reviewed-on: https://chromium-review.googlesource.com/222720
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Tested-by: Zhenyao Mo <zmo@chromium.org>
|
|
3b5c2dae
|
2014-08-19T15:23:32
|
|
Add a new invariant declaration operator.
BUG=angle:711
Change-Id: I54a48b636a68c317b8d44ee2d578847b80095289
Reviewed-on: https://chromium-review.googlesource.com/213500
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
5f438061
|
2014-08-20T16:38:34
|
|
Only set declaration operator if not already set.
This allows us to return different operators from single
declarations, which will be useful for treating invariant
declarations as different operators.
BUG=angle:711
Change-Id: Id278b91854bbefe8e635380d7b27198198236fef
Reviewed-on: https://chromium-review.googlesource.com/212939
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
|
|
47e3ec08
|
2014-08-20T16:38:33
|
|
Add a helper method to parse invariant declarations.
This pulls out more functionality from the grammar into simple
c++ source files.
BUG=angle:711
Change-Id: I19121d710dc1543585361cb53a0deb2ea0479db9
Reviewed-on: https://chromium-review.googlesource.com/212938
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
|
|
5c09702f
|
2014-08-20T16:38:32
|
|
Add a getNamedVariable helper method to TParseContext.
This method will be useful in more than one place, since we need
to get a TType from an indentifier when parsing invariant
declarations.
BUG=angle:711
Change-Id: I1c1befbdcc93ea626428fb4e313b8c6326c158f6
Reviewed-on: https://chromium-review.googlesource.com/212937
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
|
|
e40d1e9c
|
2014-07-16T17:40:36
|
|
Fix style violations.
BUG=angle:650
TEST=no behavior change
Change-Id: I3096615a181b1ec2c18ce60566c3d6249975b84e
Reviewed-on: https://chromium-review.googlesource.com/208569
Tested-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
183bde55
|
2014-07-02T15:31:19
|
|
Return shader variable information using GLenum values.
Instead of duplicating GL header define values, explictly return
GLenum for variable queries in the shader inspection API. This
reduces the duplicate defines in the shader compiler header.
BUG=angle:466
Change-Id: Iddaaff597b188251fa2e546f352bf77ab3ac43bc
Reviewed-on: https://chromium-review.googlesource.com/205860
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
|
|
ce505553
|
2014-06-26T14:56:33
|
|
Revert "Return variable type queries using GLenum values."
Breaks the FYI bots until we get Chromium patched.
BUG=angle:466
This reverts commit 53221f5a0382887155d90f7f286e41190d4f5bfb.
Change-Id: Ib28548df5c10a6f76f46e4cf8f2013dca5cf0ee2
Reviewed-on: https://chromium-review.googlesource.com/205850
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
53221f5a
|
2014-06-25T16:04:59
|
|
Return variable type queries using GLenum values.
Instead of duplicating GL header define values, explictly return
GLenum for variable queries in the shader inspection API. This
reduces the duplicate defines in the shader compiler header.
BUG=angle:466
Change-Id: If631b20ce68747297a946e1371def7709027a613
Reviewed-on: https://chromium-review.googlesource.com/204937
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
adfffe46
|
2014-06-17T02:13:36
|
|
Duplicate reused symbol table entries.
BUG=angle:651
Change-Id: Ifce3c19d41a0a5a5ca5ee90ede528adf397d1da5
Reviewed-on: https://chromium-review.googlesource.com/204290
Tested-by: Nicolas Capens <nicolascapens@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
|
|
74be6a84
|
2014-05-29T14:33:28
|
|
Fix missing bracket in translator source.
Broken in ed14b79dc8e9ec4f4a831bb5213ab67ef01af196.
BUG=angle:628
Change-Id: Ia6b92dd13362bb51f0aa17a14278039d568f5434
Reviewed-on: https://chromium-review.googlesource.com/202182
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
ed14b79d
|
2014-05-08T11:21:07
|
|
Shaders should fail compile if a boolean's precision is specified
Tested and no regression on WebGL conformance 1.0.3
BUG=angle:628
BUG=368874
TEST=http://www.khronos.org/registry/webgl/sdk/tests/conformance/glsl/misc/boolean_precision.html
Change-Id: Ie74616c3ab846eea19f4bd4a041fc0f00d55f151
Reviewed-on: https://chromium-review.googlesource.com/198884
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Tested-by: Zhenyao Mo <zmo@chromium.org>
|
|
12bea0a9
|
2014-04-11T13:33:55
|
|
Stop shader local variables from using invalid qualifiers.
Local variables in GLSL can't use any other storage qualifier than
'const', but we weren't checking properly. For example, the can't
have 'in' or 'out' storage. This was causing a dEQP conformance
test failure.
BUG=angle:593
Change-Id: Ibb333950f2d0990a47d1a96caecc455497d5e57e
Reviewed-on: https://chromium-review.googlesource.com/191460
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
5c55caf3
|
2014-02-18T15:27:18
|
|
Fix bugged tokens marked as reserved/free in ES2.
We had accidentally marked 'smoooth', 'centroid' and 'case'
as reserved in ES2, when they are available as identifiers.
Additionally 'sampler2DShadow' was marked as free, instead
of reserved.
BUG=angle:550
Change-Id: I33ec1b790ad5b4d9a6f4d2ea2e91cec1ca8e7320
Reviewed-on: https://chromium-review.googlesource.com/186970
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
44cc79f6
|
2014-01-03T10:57:22
|
|
Fix compiler crash.
Create a fake variable for function identifiers used as a variable identifier to allow continuing compilation after reporting the error.
BUG=chromium:330222
Change-Id: I96c330694e3503fe2df66621375d2bf76115e325
Reviewed-on: https://chromium-review.googlesource.com/181491
Tested-by: Nicolas Capens <nicolascapens@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|