|
029e8ca7
|
2018-02-16T14:06:49
|
|
Add a constexpr constructor for TFunction
Access to TFunction parameters is now handled through two new members:
a pointer to a parameter array and a parameter count.
There's still also a vector pointer in TFunction for adding function
parameters one by one. This is used when parsing user-defined
functions.
TEST=angle_unittests
BUG=angleproject:2267
Change-Id: I86987ae56b7cf37f010d0651e9861789050aec2b
Reviewed-on: https://chromium-review.googlesource.com/923987
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
697bf65c
|
2018-02-16T11:50:54
|
|
Avoid redundant symbol lookup when parsing functions
The lexical phase looks up symbols when it encounters an identifier.
Instead of duplicating this work when parsing non-constructor
functions, we now store the symbol looked up in the lexical phase in
TFunctionLookup.
This improves scores of the real world shader compiler perf test by
1-2%.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Idc99776571313d8b654910f9daaf9bf34a048228
Reviewed-on: https://chromium-review.googlesource.com/923725
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
e80825ef
|
2018-02-16T10:24:53
|
|
Simplify built-in function node initialization
Built-ins with no math op associated with them now have the op code
EOpCallBuiltInFunction set. This makes initializing built-in function
nodes simpler, since they can always get the op code from the function
symbol.
We also no longer look for functions in inner scopes, only from the
global scope and from built-in functions.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I55a2642f34bb3c8b8f13183c95fa509ec3b9cfdb
Reviewed-on: https://chromium-review.googlesource.com/923724
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
b5db2b49
|
2018-02-12T15:31:56
|
|
Enable -Wimplicit-fallthrough for ANGLE.
Also teach MSVC that ANGLE_CRASH() can't return.
Also fix instances of the warning in build configurations where
UNREACHABLE() can return (e.g. release without dcheck_always_on
or debug).
If the UNREACHABLE()s are truly unreachable, this change has
no behavior change.
Bug: chromium:810767
Change-Id: I68f3587cf3e268c3ef634dce7ae3d70399859d0f
Reviewed-on: https://chromium-review.googlesource.com/914842
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
|
|
defe3937
|
2018-02-13T11:56:09
|
|
Store invariant varying names as ImmutableString
This gets rid of a few extra ImmutableString to std::string
conversions which makes the code clearer. There doesn't seem to be any
significant effect on performance.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I36ebbc8a4130ab8f9d6194feca83ec5dcbc95f78
Reviewed-on: https://chromium-review.googlesource.com/916141
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
41b072b6
|
2018-02-09T10:01:32
|
|
Prepare for -Wimplicit-fallthrough in ANGLE.
Disable the warning for flex-generated output, which contains
lots of intentional fallthrough.
Fixes a bug where GL_SAMPLE_ALPHA_TO_ONE_EXT would fall through
to GL_COVERAGE_MODULATION_CHROMIUM and hence behave like that.
Fixes a bug in the D3D9 state management where invalidating
DIRTY_BIT_POLYGON_OFFSET would also invalidate the stencil bits.
One somewhat common incorrect pattern in ANGLE is nested switch
statements that look like so:
switch (a) {
case a1:
switch (b) {
case b1:
...
break;
}
case a2:
...
}
The assumption here seems to be that the breakk exits the outer
case (here a1), while it in fact only exits the inner switch,
so that we fall through to a2. In most places, I fixed this
by adding an explicit `break` after the inner switch.
This fixes a bug wher GL_PATH_JOIN_STYLE_CHROMIUM would fall through to
GL_PATH_MITER_LIMIT_CHROMIUM in validation (but since the join style
enum is always > 0, this happened to not have an effect in practice).
This also fixes 87 bugs in GetLoadFunctionsMap() where invalid
values would previously return an unrelated function map instead
of the empty load function map.
Bug: chromium:810767
Change-Id: Ib51388c73fbfc229160e2c10f8fb9364cc7c996c
Reviewed-on: https://chromium-review.googlesource.com/911529
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
fbb1c792
|
2018-01-19T16:26:59
|
|
Store symbol names as a ImmutableString
This will enable compile-time initialization of built-in symbols as
well as reducing copying strings.
Most of the code that deals with names is changed to use
ImmutableString where it makes sense to avoid conversions.
The lexer/parser now allocate const char pointers into pool memory
instead of allocating TStrings. These are then converted to
ImmutableString upon entering TParseContext.
BUG=angleproject:2267
TEST=angle_unittests, angle_end2end_tests
Change-Id: I244d6271ea1ecf7150d4f89dfa388a7745a1150c
Reviewed-on: https://chromium-review.googlesource.com/881561
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
95ed1947
|
2018-02-01T14:01:19
|
|
Add a class for function lookups
Using a purpose-built class for function lookups instead of using
a combination of TFunction and a struct container for the this node
and arguments makes the code clearer.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I3f345d836abeaa7f84cc46b4b840fd06c7e2e1a7
Reviewed-on: https://chromium-review.googlesource.com/897363
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
37b697ed
|
2018-01-29T12:19:27
|
|
Only return symbol from TSymbolTable::find
Whether the symbol is built-in can be easily determined from the
SymbolType stored in the symbol, it doesn't need to be returned
separately. The sameScope value that could be returned from
TSymbolTable::find was never used, so that can be removed as well.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I06958741ebec67d496f830a83b4f6f1359632f45
Reviewed-on: https://chromium-review.googlesource.com/891021
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
68981eb5
|
2018-01-23T17:46:12
|
|
Track parameter qualifiers of functions in call nodes
We now add a reference to TFunction to all TIntermAggregate nodes
where it is possible, including built-in ops. We also make sure
that internal TFunctions added in traversers have correct parameter
qualifiers.
This makes TLValueTrackingTraverser much simpler. Instead of storing
traversed functions or looking up builtin functions from the symbol
table, determining which function parameters are out parameters can
now be done simply by looking it up from the function symbol
associated with the aggregate node.
Symbol instances are no longer deleted when a symbol table level goes
out of scope, and TFunction destructor no longer clears the
parameters. They're all either statically allocated or pool allocated,
so this does not result in leaks.
TEST=angle_unittests
BUG=angleproject:2267
Change-Id: I57e5570da5b5a69a98a8778da3c2dc82b6284738
Reviewed-on: https://chromium-review.googlesource.com/881324
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
dd21ecf8
|
2018-01-10T12:42:09
|
|
Add const qualification to symbol accesses
All accesses to built-in symbols now happen through const-qualified
pointers.
This also encapsulates TSymbolTableLevel inside TSymbolTable.
This prepares for statically allocating built-in symbols.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I473014d978daa765b4a733d761d6c08b28288776
Reviewed-on: https://chromium-review.googlesource.com/859959
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
0e99b7a3
|
2018-01-12T12:05:48
|
|
Prevent changing AST expression type from outside
TIntermNode classes now contain all the logic for setting node types.
Changing the constant values of constant union nodes from outside is
also not necessary anymore.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Ic10d41b1e5f93152df440a655057591dc1b783b0
Reviewed-on: https://chromium-review.googlesource.com/863626
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
b60d30f7
|
2018-01-16T12:31:06
|
|
Make TVariable type immutable
This enables using constexpr types for built-in variables and some of
the variables created in AST transformations.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Ie85b3c9872a071a7c023ced013b14ad91cff7cee
Reviewed-on: https://chromium-review.googlesource.com/868134
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
ea22b7a5
|
2018-01-04T17:09:11
|
|
Constant fold array indexing and comparison
A virtual function to get the constant value of an AST node is added
to TIntermTyped. This way a constant value can be retrieved
conveniently from multiple different types of nodes. TIntermSymbol
nodes pointing to a const variable can return the value associated
with the variable, constructor nodes can build a constant value from
their arguments, and indexing nodes can index into a constant array.
This enables constant folding operations on constant arrays, while
making sure that large amounts of data are not duplicated in the
output shader. When folding an operation makes sense, the values of
the arguments can be retrieved by using the new
TIntermTyped::getConstantValue(). When folding an operation would
result in duplicating data, the AST can just be left to be written out
as is.
For example, if the code contains a constant array of arrays, indexing
into individual elements of the inner arrays can be folded, but
indexing the top level array is left in place and not replaced with
duplicated array literals.
Constant folding is supported for indexing and comparisons of arrays.
In case constant arrays are only referenced through foldable
operations, the variable declarations will be pruned from the AST by
the RemoveUnreferencedVariables step.
BUG=angleproject:2298
TEST=angle_unittests
Change-Id: I5b3be237b7e9fdba56aa9bf0a41b691f4d8f01eb
Reviewed-on: https://chromium-review.googlesource.com/850973
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
c74ec1a5
|
2018-01-09T15:23:28
|
|
Record gl_in array size in a symbol in ParseContext
Instead of referring to the gl_in symbol in the symbol table, create
a gl_in symbol with the right array size once the array size is known.
This makes the type of TIntermSymbol nodes pointing to gl_in
consistent with the variable type.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I31673d33526a91f8d069ee8d7d2f181a49665fd0
Reviewed-on: https://chromium-review.googlesource.com/857004
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
765924f0
|
2018-01-04T12:48:36
|
|
Fold ternary and comma ops only after parsing is done
In case folding a ternary op or a comma op would change the qualifier
of the expression, the folding is deferred to a separate traversal
step.
After this there are no more cases where the type of a TIntermSymbol
node needs to differ from the type of the variable it is referring to.
There are still some cases where some parts of TIntermSymbol type are
changed while keeping the TVariable type the same though, like when
assigning array size to gl_PerVertex nodes or sanitizing qualifiers of
struct declarations.
BUG=angleproject:2267
TEST=angle_unittests, angle_end2end_tests
Change-Id: I1501c8d361f5f765f43ca810d1b7248d9e2c5986
Reviewed-on: https://chromium-review.googlesource.com/850672
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
8b5e8fdb
|
2017-12-15T14:59:15
|
|
Replace remaining usage of TName with TSymbol
TName used to contain just a subset of the information stored in
TSymbol. It makes more sense to use TSymbol directly instead of
converting it to TName.
This also improves type safety a bit by making some functions only
take in TVariable or TFunction instead of the more generic TName.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Icb46923c25d33ebbbbc06ddc487da25957dda771
Reviewed-on: https://chromium-review.googlesource.com/829143
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
492b5f51
|
2017-12-13T09:39:27
|
|
ES31: Support struct arrays as Geometry Shader inputs
This patch adds the support of struct arrays as valid
geometry shader user-defined inputs.
Struct arrays are accepted as geometry shader inputs to
match the vertex shader outputs that are also declared
as structs.
BUG=angleproject:1941
TEST=angle_unittests
Change-Id: I0b5d545b10e9dda576a1c96d7c93ec2450611e9e
Reviewed-on: https://chromium-review.googlesource.com/823622
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
bed35d76
|
2017-12-20T16:36:26
|
|
Don't query names of empty symbols
This makes it possible to return a reference from TSymbol::name()
instead of a pointer. This is safer since it completely avoids the
possibility of a nullptr dereference. An assert is making sure that
the function is not being called for empty symbols.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I44279f65989dbb828322843fc0216ba84d91dedf
Reviewed-on: https://chromium-review.googlesource.com/836894
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
f095799b
|
2017-12-22T11:10:04
|
|
Fix accessing the name of a nested struct definition
When generating an error message about the struct nesting limit, the
code should make sure that the struct definitions are not nested.
While nested struct definitions by themselves are also an error,
they're not a syntax error so parsing will continue after encountering
them.
This fixes a regression from commit: Don't allocate name strings for
empty symbols.
BUG=chromium:797156
TEST=angle_unittests
Change-Id: I4149fbe874c0e7ec90e690aec078ccaf7313eab0
Reviewed-on: https://chromium-review.googlesource.com/842643
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
b6af22b5
|
2017-12-15T14:05:44
|
|
Store TVariable* in TIntermSymbol instead of storing id
This is an intermediate step to only storing a TVariable * in
TIntermSymbol instead of copying the name.
This makes it possible to get a constant value out of a TIntermSymbol
without doing a symbol table lookup.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Ibff588241a4ad4ac330063296273288b20a072c9
Reviewed-on: https://chromium-review.googlesource.com/829142
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
beb6dc74
|
2017-12-14T16:03:03
|
|
Always use TFunction instead of TFunctionSymbolInfo
This reduces unnecessary memory allocations and conversions between
different objects containing the same data.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I87316509ab1cd6d36756ff6af7fa2b5c5a76a8ea
Reviewed-on: https://chromium-review.googlesource.com/827134
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
1bb8528c
|
2017-12-14T13:39:53
|
|
Remove TFunctionSymbolInfo from TIntermAggregate
All the information stored in TFunctionSymbolInfo was duplicated from
the TFunction that the aggregate node pointed to.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I1f5574ab0416e5cae00c3dae6fc11d2fe1fa128c
Reviewed-on: https://chromium-review.googlesource.com/827065
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
0c37100d
|
2017-12-13T17:00:25
|
|
Always create TFunctions for function call nodes
This simplifies code and ensures that nodes get consistent data.
In the future function call nodes could have a pointer to the
TFunction instead of converting the same information into a different
data structure.
BUG=angleproject:2267
TEST=angle_unittests, angle_end2end_tests
Change-Id: Ic0c24bb86b44b9bcc4a5da7f6b03701081a3af5c
Reviewed-on: https://chromium-review.googlesource.com/824606
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
ae4dbf32
|
2017-12-08T20:49:00
|
|
Don't allocate name strings for empty symbols
This removes unnecessary memory allocations.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Ide575ea19ab2f8e9fc93092490f1352efa6024a3
Reviewed-on: https://chromium-review.googlesource.com/817415
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
a2d98141
|
2017-12-15T14:18:55
|
|
Fix allowing non-constant ternary global initializer
Check the qualifier of a node resulting from the folding of a ternary
node correctly. The folded node might even be a TIntermConstantUnion
with a non-constant qualifier.
BUG=angleproject:2285
TEST=angle_unittests
Change-Id: I74516e44ce9d78bc54093a5b58d14cf33a57e6e5
Reviewed-on: https://chromium-review.googlesource.com/829138
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
195be942
|
2017-12-04T23:40:14
|
|
Always create TVariables for TIntermSymbol nodes
TIntermSymbol nodes are now constructed based on a specific TVariable.
This makes sure that all TIntermSymbol nodes that are created to refer
to a specific temporary in an AST transform will have consistent data.
The TVariable objects are not necessarily added to the symbol table
levels - just those variables that can be referred to by their name
during parsing need to be reachable through there.
In the future this can be taken a step further so that TIntermSymbol
nodes just to point to a TVariable instead of duplicating the
information.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I4e7bcdb0637cd3b588d3c202ef02f4b7bd7954a1
Reviewed-on: https://chromium-review.googlesource.com/811925
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
bd924af1
|
2017-11-16T15:28:04
|
|
ES31: Remove support of GL_OES_geometry_shader in compiler
This patch intends to remove the support of GL_OES_geometry_shader
in ANGLE compiler.
To make the implementation simpler, currently we decide to only
support "GL_EXT_geometry_shader" as the extension string of geometry
shader in ANGLE.
This patch also updates all the related shaders in angle_unittests
into R"()" format.
BUG=angleproject:1941
TEST=angle_unittests
Change-Id: Ife9858abeedfb46b02c5c2fb1cda16fa27198511
Reviewed-on: https://chromium-review.googlesource.com/773451
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
9d4d7f06
|
2017-12-07T17:11:41
|
|
Classify TSymbols using an enum
Symbols can be either built-ins, user-defined, nameless, or for
ANGLE's internal use. In addition we currently use TFunction symbols
that are not yet resolved - they might later resolve to either a
built-in or a user-defined function. Record this information in each
TSymbol so that TSymbol contains sufficient information for deciding
how to format symbol names in output.
The goal is to eventually replace current uses of TName with pointers
to different TSymbol objects. So far only built-ins and user-defined
symbols have associated TSymbol objects, but that will be expanded to
cover ANGLE's internal symbols as well.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I927ce023fe257cc236da82c127700f3bd72bfe96
Reviewed-on: https://chromium-review.googlesource.com/816952
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
378c3a51
|
2017-12-04T11:32:13
|
|
Clean up storing interface blocks in the symbol table
Merge TInterfaceBlock with TInterfaceBlockName, so that there are no
duplicate data structures for interface blocks. This is similar to the
refactoring that was already done to structs.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I67d2af6ccbe5344bddf9c99030d118fe532fbbd8
Reviewed-on: https://chromium-review.googlesource.com/805819
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
12a18ad3
|
2017-12-01T16:59:47
|
|
Simplify interface block instance recording
Instead of storing instance names as part of TInterfaceBlock, store
instance names only in interface block instance symbols. Wherever the
instance name is needed it can be fetched from the instance symbol.
BUG=angleproject:2267
TEST=angle_end2end_tests
Change-Id: Ia265e4db7901eebec57c9c3769d84c17651a35ba
Reviewed-on: https://chromium-review.googlesource.com/803221
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
614dd0f5
|
2017-11-22T14:04:48
|
|
Replace TCache with static TType instances
Replaces TCache with (static generation + static/dynamic lookups) of
TType instances, using compile-time template and constexpr magic.
Work started by jmadill here: https://crrev.com/c/776280
With more contributions from jmadill here: https://crrev.com/c/801494
Bug: angleproject:1432
Change-Id: I07181543f8fee4b2606cdd2d0738351e83d4ce57
Reviewed-on: https://chromium-review.googlesource.com/786317
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
d5f44c98
|
2017-11-29T17:15:40
|
|
Simplify parsing struct field declarators
This removes the dummy type that was attached to struct declarators
while parsing. This makes TParseContext::addStructDeclaratorList in
particular simpler to understand.
The new TDeclarator data type is the parsed representation of the
struct_declarator grammar rule. It is completely immutable. The name
and location stored in TField can also be qualified as constant now.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I2834f87fc0eee0bdb7673ef495a55fb463023c55
Reviewed-on: https://chromium-review.googlesource.com/797033
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
54a29ffd
|
2017-11-28T17:35:20
|
|
Refactor TSymbol to follow naming conventions
This will make it easier to make TStructure inherit from TSymbol.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I73a5a25234c7f965b6970891821ee9d6f0a23aca
Reviewed-on: https://chromium-review.googlesource.com/793812
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
f13cadd8
|
2017-11-28T10:53:09
|
|
Fix checking negative index when indexing matrix/vector
It's important that the test against the maximum of the valid range
is only done if the index is positive, so the sanitized index value
is guaranteed to end up in the valid range.
This fixes a regression from commit "Add GLSL support for
runtime-sized arrays in SSBOs".
BUG=chromium:789029
TEST=angle_unittests
Change-Id: Ic7125e383a64e46994b072df6d7e642432c521af
Reviewed-on: https://chromium-review.googlesource.com/792935
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
57ea533f
|
2017-11-22T14:04:48
|
|
TType: Store array sizes vector as a pointer.
This makes TType a literal type, and thus is something that could be
constexpr.
Work started by jmadill here: https://crrev.com/c/776278
Bug: angleproject:1432
Change-Id: I707ddf81eaf029f49d62d2836b7166d265cbdfa1
Reviewed-on: https://chromium-review.googlesource.com/786316
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
ebee5b3b
|
2017-11-23T12:56:32
|
|
Add GLSL support for runtime-sized arrays in SSBOs
The GLSL parser now allows a runtime-sized array as the last member in
a shader storage block. Clamping indexing against the memory bounds is
done by determining the array length at runtime.
Runtime-sized arrays are used in dEQP tests for many compute shader
tests, so these now work on the OpenGL backend.
BUG=angleproject:1951
TEST=angle_unittests,
dEQP-GLES31.functional.shaders.linkage.shader_storage_block.*
dEQP-GLES31.functional.shaders.builtin_functions.*compute*
Change-Id: Ibecca24623ca8e4723af6f0e0421fe9711ea828d
Reviewed-on: https://chromium-review.googlesource.com/787976
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
7881cfdf
|
2017-08-23T18:00:21
|
|
Add parsing of arrays of arrays
This changes the grammar so that multiple array sizes can be chained
together, and adds arrays of arrays support to TPublicType. In
TPublicType the array sizes are stored using a pointer to a vector, a
plain vector won't work due to bison restrictions.
A larger subset of program interface query tests now pass. Some are
still failing due to unrelated bugs.
BUG=angleproject:2125
TEST=angle_unittests, angle_end2end_tests,
dEQP-GLES31.functional.shaders.arrays_of_arrays.*
dEQP-GLES31.functional.uniform_location.nested_array.*
dEQP-GLES31.functional.program_interface_query.*
dEQP-GLES31.functional.ubo.*level*array.*
Change-Id: Iee16477a3752b953f5068c0473a2ed62fead8155
Reviewed-on: https://chromium-review.googlesource.com/633944
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
2f294c9a
|
2017-11-20T14:47:26
|
|
Add constructors for TMemoryQualifier and TLayoutQualifier.
These replace the ::create methods, to facilitate constexpr versions.
Also adds a constructor of WorkGroupSize that can be made to be
constexpr.
Bug: angleproject:1432
Change-Id: I413d1a56102c94d6a383775110a2b850a7532ea0
Reviewed-on: https://chromium-review.googlesource.com/776279
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
|
|
a3106c58
|
2017-11-03T09:39:39
|
|
ES31: Add atomic memory functions
BUG=angleproject:1442
TEST=angle_unittests, angle_end2end_tests
dEQP-GLES31.functional.compute.shared_var.atomic*
dEQP-GLES31.functional.compute.basic.shared_atomic_op*
dEQP-GLES31.functional.ssbo.atomic.*
Change-Id: I82b54fde3a852d3bd917b1e19680baa1c28fce4d
Reviewed-on: https://chromium-review.googlesource.com/765061
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
1d33c219
|
2017-11-13T10:21:39
|
|
Fix standalone mac compilation
BUG=
Change-Id: I225bd1693f595a64179b8e500cb1e7101fd2e197
Reviewed-on: https://chromium-review.googlesource.com/766472
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
7af63727
|
2017-11-13T15:03:40
|
|
Fix nullptr dereference on struct parameter error
Function parameter name string does not necessarily exist, so it's
better to use the function name as the token in the error message.
BUG=chromium:784158
TEST=angle_unittests
Change-Id: I8f3b8604fd702bdc9486b8d721a5f60de1ff3fa7
Reviewed-on: https://chromium-review.googlesource.com/765972
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
703671e9
|
2017-11-08T17:47:18
|
|
Unify extension behavior checks
Some supportsExtension and isExtensionEnabled checks are now turned
into checkCanUseExtension checks. Using checkCanUseExtension is
preferable so that warnings are generated correctly when an extension
is used and a warn directive is present.
isExtensionEnabled is still used in some places where an error message
about the extension could be confusing, particularly when a core spec
version adds support for something that is also present in an
extension.
Also make it possible to disable ARB_texture_rectangle extension using
an extension directive. ARB_texture_rectangle extension functionality
is enabled by default in GLSL when the extension is supported.
BUG=angleproject:2238
TEST=angle_unittests
Change-Id: I7455293412ff469f54bc7da79df146e7bc127379
Reviewed-on: https://chromium-review.googlesource.com/760737
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
0e883134
|
2017-10-26T09:53:50
|
|
ES31: Support EXT_geometry_shader in GLSL compiler
This patch intends to support "EXT_geometry_shader" as a valid
extension string in ANGLE GLSL compiler.
We decide to support it because in dEQP-GLES31 all geometry
shader related tests are using "EXT_geometry_shader" instead of
"OES_geometry_shader".
1. Support new extension string "EXT_geometry_shader"
2. Enable geometry shader layout qualifiers with EXT_geometry_shader
3. Enable geometry shader builtins with EXT_geometry_shader
BUG=angleproject:1941
TEST=angle_unittests
Change-Id: Iaedd01a9100ccf56243c957db36ff0c983d17060
Reviewed-on: https://chromium-review.googlesource.com/737933
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
ef7fb388
|
2017-11-07T16:33:49
|
|
Size const unsized arrays without an initializer
The array size for unsized arrays needs to be sanitized in all cases,
since subsequent checks on array indexing depend on all arrays being
sized.
BUG=chromium:781729
TEST=angle_unittests
Change-Id: I3af6c08bb249a19f7c2ef169c877a2b863eb31d3
Reviewed-on: https://chromium-review.googlesource.com/757101
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
d80f2944
|
2017-11-06T12:44:45
|
|
Struct definition not allowed as function parameter type
Struct definitions are not allowed as a function parameter type now.
This is specified in ESSL 3.00.6 section 12.10. ESSL 3.00.6 section
6.1.1 contradicts this, but that seems like a mistake, it's been fixed
in subsequent spec versions.
BUG=angleproject:2225
TEST=angle_unittests
Change-Id: I6b97d120c440f0c0a45d31bbfaf292fb497160ce
Reviewed-on: https://chromium-review.googlesource.com/754606
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
b8ee9dd3
|
2017-10-30T12:43:27
|
|
Validate empty statements in switch statements
Even an empty statement like ";" is a statement according to the
grammar. They should not be allowed in switch statements before the
first case statement, but on the other hand a switch statement that
has just an empty statement after the last statement is valid.
Now the parser creates AST nodes from empty statements so that we can
validate switch statements correctly. However, they are pruned shortly
after parsing completes in PruneNoOps, so they don't affect further
processing of the AST.
BUG=angleproject:2181
TEST=angle_unittests
Change-Id: I1085056fc34b146142546fc5f2b7f3124b910ab9
Reviewed-on: https://chromium-review.googlesource.com/743621
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
722bfb51
|
2017-10-26T17:00:11
|
|
Fix detecting duplicate field names in structures
Previously field names that were listed in the first declarator list
inside a struct declaration were not checked against each other.
BUG=angleproject:2204
TEST=angle_unittests
Change-Id: Ibf821d45556f6dfe0223dae673644f6795daf4cb
Reviewed-on: https://chromium-review.googlesource.com/739825
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
55bc905f
|
2017-10-25T17:33:06
|
|
Always consider type arrayness for atomic counters
Atomic counter arrays may be declared with various different syntax -
the array size may be declared as a part of the type or as a part of
the declarator. Take this into account when determining whether atomic
counter offsets overlap.
BUG=angleproject:1729
TEST=angle_unittests
Change-Id: I7435ded9401c4c1caab22c22d83fd2ad301df768
Reviewed-on: https://chromium-review.googlesource.com/738140
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
ca68d988
|
2017-09-18T16:41:56
|
|
ES31: Add std430 support for OpenGL backend
BUG=angleproject:1920
TEST=angle_unittests
Change-Id: Ie8e171abec053c2c5dca93d6e79db534f74520e7
Reviewed-on: https://chromium-review.googlesource.com/737532
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
4ddae359
|
2017-10-26T16:20:18
|
|
Use array_specifier in struct declarator parsing
This will make implementing arrays of arrays simpler for struct
members as well. Similar refactoring was already done for other types
of array declarations.
BUG=angleproject:2125
TEST=angle_unittests
Change-Id: I0483c3a7c006d37090c7c972cb3d7763d3909c8f
Reviewed-on: https://chromium-review.googlesource.com/739824
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
|
|
9cd7163e
|
2017-10-26T14:43:20
|
|
Fix setting array sizes on a constructor
Take any array sizes that have been explicitly specified in the shader
text into account, and only set the ones that are unsized according to
the arguments.
BUG=angleproject:2125
TEST=angle_unittests
Change-Id: I37d08a86c25f7cd4f3ce5689f2c9fad444e7d5ad
Reviewed-on: https://chromium-review.googlesource.com/738141
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
454c34cb
|
2017-10-25T16:35:56
|
|
Accept valid geometry shader inputs regardless of syntax
Before, only the following style of declarations were accepted:
in float f[];
Now also these styles are accepted:
in float[] f;
in float f[], g[];
BUG=angleproject:2201
TEST=angle_unittests
Change-Id: I0af7d355a5e06a67ceef2d6bd69af7e23c180a04
Reviewed-on: https://chromium-review.googlesource.com/738234
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
55bde916
|
2017-10-25T13:41:13
|
|
Parse array specifier with a separate grammar rule
This brings the grammar closer to the GLSL ES 3.10 spec.
Some corner cases related to handling unsized arrays are fixed.
BUG=angleproject:2125
TEST=angle_unittests, angle_end2end_tests
Change-Id: I9bcf87b17b97da0e2ec2954d32037c272fde3080
Reviewed-on: https://chromium-review.googlesource.com/738233
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
8e4b355b
|
2017-08-30T14:20:58
|
|
ES31: Implement Geometry Shader inputs and outputs
This patch intends to implement Geometry Shader inputs and
outputs in ANGLE GLSL compiler.
1. Only accept arrays as the inputs of a Geometry Shader.
2. Allow unsized arrays as the inputs of a Geometry Shader after a
valid input primitive declaration and assign size to them.
3. Implement Geometry Shader outputs.
4. Allow Geometry Shader inputs and outputs using interpolation
qualifiers ('flat', 'smooth', 'centroid').
5. Allow using 'location' layout qualifier on Geometry Shader inputs
and outputs.
BUG=angleproject:1941
TEST=angle_unittests
Change-Id: Ia7e250277c61f45c8479437b567c2831ff26b433
Reviewed-on: https://chromium-review.googlesource.com/650211
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
cbcb96fc
|
2017-10-19T14:14:06
|
|
Fix switch/case last case validation for ESSL 3.10
No statement should be required after the last case label of a switch
statement in ESSL 3.10. The validation is still kept for ESSL 3.00 for
dEQP compatibility. If the dEQP tests are changed in the future, we
might consider just issuing a warning regardless of shader version.
BUG=angleproject:2189
TEST=angle_unittests
Change-Id: Ic53e71e0176668a7dbffa315712885846e217f03
Reviewed-on: https://chromium-review.googlesource.com/727802
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
2d88e9bc
|
2017-07-21T16:52:03
|
|
Guarantee that symbol nodes get unique ids
The code is refactored so that symbol nodes can only be initialized
with an unique id object. This prevents accidentally forgetting to
create an id for a symbol node.
This opens up possibilities for future optimization: For example the
names and types of symbols could be stored in a central location
inside the SymbolTable, and TIntermSymbol nodes would only need to
store the symbol id. The symbol id could be used to look up the name
and type of the node.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: Ib8c8675d31493037a5a28c7b36bb9d1113cc10f6
Reviewed-on: https://chromium-review.googlesource.com/580955
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
923ecef6
|
2017-10-11T12:01:38
|
|
Fix switch statement validation corner cases
The grammar needs to generate AST nodes even for no-op statements,
since they might be the last statement in a switch statement that is
required for switch statement validity. Change the grammar to generate
nodes from empty blocks and empty declarations.
We also need to do some further processing of the AST. This is because
PruneEmptyDeclarations will still remove empty declarations, and at
least the NVIDIA driver GLSL compiler doesn't accept some types of
no-op statements as the last statement inside a switch statement. So
after parsing has finished we do rudimentary dead code elimination to
remove dead cases from the end of switch statements.
BUG=angleproject:2181
TEST=angle_unittests
Change-Id: I586f2e4a3ac2171e65f1f0ccb7a7de220e3cc225
Reviewed-on: https://chromium-review.googlesource.com/712574
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
4cc89e2b
|
2017-08-31T14:25:54
|
|
ES31: Enable 'location' layout qualifier on shader interfaces in compiler
This patch enables 'location' layout qualifier for vertex outputs and
fragment shader inputs when the shader version is 3.1 in ANGLE GLSL
compiler and adds the check on location conflicts for these varyings.
According to GLSL ES 3.1 SPEC (Chapter 4.4.1 and Chapter 4.4.2),
'location' layout qualifier is allowed on both inputs and outputs of
vertex and fragment shaders.
'location' layout qualifier on shader interfaces is only valid on shaders
whose version is 3.1 and above. According to GLSL ES 3.0 SPEC, vertex shader
cannot have output layout qualifiers (Chapter 4.3.8.2) and fragment shader
cannot have input layout qualifiers (Chapter 4.3.8.1).
The 'location' qualifier on varyings is used in the shader interface
matching defined in OpenGL ES 3.1. (OpenGL ES 3.1 SPEC Chapter 7.4.1). This
new link rule will be added to Program.cpp in another patch.
For the OpenGL ES 3.1 extension GL_OES_geometry_shader, according to
GL_OES_shader_io_blocks SPEC (Chapter 4.4.1 and Chapter 4.4.2), 'location'
layout qualifier is both valid on geometry shader inputs and outputs. This
feature will be implemented together with other rules on geometry shader
inputs and outputs.
BUG=angleproject:2144
TEST=angle_unittests
Change-Id: I62d85f7144c177448321c2db36ed7aaeaa1fb205
Reviewed-on: https://chromium-review.googlesource.com/645366
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
84aa2dcf
|
2017-09-11T15:51:02
|
|
Add textureGather and textureGatherOffset
The patch adds new built-ins and extends the semantic parser to add
support for textureGather and textureGatherOffset.
BUG=angleproject:1442
TEST=angle_unittests
TEST=angle_deqp_gles31_tests.exe
--deqp-case=dEQP-GLES31.functional.texture.gather*
--deqp-egl-display-type=angle-gl
Change-Id: Iaf98c3420fbd61193072fdec8f5a61ac4c574101
Reviewed-on: https://chromium-review.googlesource.com/660124
Commit-Queue: Martin Radev <mradev@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
bb5a7e29
|
2017-08-30T13:03:12
|
|
Allow length() on arbitrary array expressions
This is required to pass some dEQP GLES 3.1 tests for arrays of
arrays, and WebGL conformance tests were also recently fixed to
require this behavior. The intent of the GLSL ES spec was not to
restrict usage of length().
In practice GL drivers don't implement array length() on expressions
with side effects correctly in all cases. HLSL doesn't have an array
length operator either. Because of this we always remove array length
ops from the AST before output.
BUG=angleproject:2142
TEST=angle_unittests, angle_end2end_tests, WebGL conformance tests
Change-Id: I863a92e83ac5315b013af9a5626348482bad72b3
Reviewed-on: https://chromium-review.googlesource.com/643190
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
2a1e8f95
|
2017-07-14T11:49:36
|
|
Refer to GLSL extensions through TExtension enum
Extensions are now referred to by enum values instead of strings most
of the time. This gets rid of unnecessary copying of strings. The code
is easier to work with than before as typoing the extension enum names
will be caught by the compiler.
BUG=angleproject:2147
TEST=angle_unittests
Change-Id: Ifa61b9f86ef03211188fc23bc23a5ce4e4d8c390
Reviewed-on: https://chromium-review.googlesource.com/571002
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
ec3a9cbb
|
2017-09-07T12:18:01
|
|
Only support GL_OVR_multiview extension variant
The WebGL spec proposal was changed so that only GL_OVR_multiview
extension name is supported, instead of having two variants
OVR_multiview and OVR_multiview2. We're only supporting the WebGL
version of the shader extension, so we drop compiler support for
GL_OVR_multiview2. Shader restrictions were also removed from the
WebGL spec, so no special validation for how ViewID_OVR gets used is
needed.
Tests that were testing for the shader restrictions are either removed
or changed from negative tests to positive tests.
BUG=angleproject:1669
TEST=angle_unittests
Change-Id: I83f92b879376d41b727b5aca419fd75fb6f53477
Reviewed-on: https://chromium-review.googlesource.com/654608
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
bb2bbfbb
|
2017-08-24T15:43:33
|
|
Refactor GLSL array length method parsing
This prepares for accepting arbitrary expressions as the "this" node
of the array length method.
BUG=angleproject:2142
TEST=angle_unittests
Change-Id: I728adb6e76d2779dedbabfaeec7d096872e0d00d
Reviewed-on: https://chromium-review.googlesource.com/633945
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
e8ef2bc4
|
2017-08-29T13:38:57
|
|
Add compile error on using inputs with interpolation qualifier as l-value
This patch intends to fix a compile error in ANGLE GLSL compiler when
parsing an expression with inputs which has interpolation qualifiers
('flat', 'smooth' and 'centroid').
The compiler should report a compile error when a shader input with
interpolation qualifier is used as a l-value.
BUG=angleproject:2140
TEST=angle_unittests
Change-Id: I7c059d53bf001ac31d34519a98e5289797833ce7
Reviewed-on: https://chromium-review.googlesource.com/640075
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
7e1197e0
|
2017-08-24T15:48:38
|
|
Fix crash when indexing unsupported interface blocks by variable
This patch intends to fix a compiler crash when indexing an
unsupported interface blocks. We should not use UNREACHABLE() here
because the compiler will continue parsing when this kind of error
is generated. Instead, we use an ASSERT to ensure the compile error
must have been reported before when the parsing reaches here.
BUG=chromium:758159
Change-Id: I4bc63316d156d51f721123fe963106d1e81d8d32
Reviewed-on: https://chromium-review.googlesource.com/631797
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
d27f5c8d
|
2017-08-23T09:38:08
|
|
ES31: Implement GL_OES_geometry_shader built-ins in GLSL compiler
This patch intends to implement all built-in constants, variables and
functions defined in OpenGL ES 3.1 extension GL_OES_geometry_shader
in ANGLE GLSL compiler.
1. Add all built-in constants defined in GL_OES_geometry_shader.
2. Add built-in functions EmitVertex() and EndPrimitive() required
in Geometry Shader.
3. Add built-in variables gl_PrimitiveIDIn and gl_InvocationID to
Geometry Shader.
4. Add built-in variables gl_PrimitiveID and gl_Layer to both
Geometry Shader and Fragment Shader when GL_OES_geometry_shader
is enabled.
BUG=angleproject:1941
TEST=angle_unittests
Change-Id: I92821553ed0efee2ccb77fead6e065e7799819d0
Reviewed-on: https://chromium-review.googlesource.com/627670
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
e080387e
|
2017-08-23T15:30:23
|
|
Refactor array element type checks
Remove checks that would never fail, and refactor the functions into
more self-contained checks. For example, it doesn't make sense to
check the qualifier from the part of the type that doesn't contain the
qualifier.
This prepares for adding the parsing of arrays of arrays.
BUG=angleproject:2125
TEST=angle_unittests
Change-Id: I1144bee35d2b04c7cb22e2bb7e17307298e35f8c
Reviewed-on: https://chromium-review.googlesource.com/629016
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
96f6adfa
|
2017-08-16T11:18:54
|
|
Add support for arrays of arrays in AST processing
Data concerning arrays of arrays is added in TType.
Parsing arrays of arrays and support for arrays of arrays in
TPublicType are still left to be implemented later.
ShaderVariable interface for arrays of arrays is also left to be
implemented later.
We rely on existing test coverage to make sure that arrays of arrays
are not accidentally exposed.
BUG=angleproject:2125
TEST=angle_unittests, angle_end2end_tests, angle_deqp_gles31_tests
Change-Id: Ie17d5ac9b8d33958e9126dc0fb40bf1c81ddeec9
Reviewed-on: https://chromium-review.googlesource.com/616146
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
d8105a03
|
2017-08-08T09:54:36
|
|
ES31: Implement gl_in in Geometry Shader
This patch intends to implement geometry shader built-in interface
block instance gl_in defined in GL_OES_geometry_shader.
1. Add the definition of gl_in and its interface block gl_PerVertex
into the symbol table.
2. Support gl_Position as a member of gl_in.
3. Set the array size of gl_in when a valid input primitive type is
known.
4. Add check that it should be a compile error to index gl_in or
call length() on gl_in without a valid input primitive declaration.
This patch also adds unit tests to cover all these new features.
BUG=angleproject:1941
TEST=angle_unittests
Change-Id: I8da20c943b29c9ce904834625b396aab6302e1e1
Reviewed-on: https://chromium-review.googlesource.com/605059
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
b18c33e9
|
2017-08-16T12:37:51
|
|
Remove arraySize in TInterfaceBlock
This patch intends to remove the field 'arraySize' in TInterfaceBlock.
The field 'arraySize' in TInterfaceBlock is redundant because:
1. If the interface block has instance name, it is recorded as one
symbol as a whole, and its array size is recorded in the TType
of the symbol.
2. If the interface block doesn't have instance name, its members are
recorded separately, and it cannot be declared as an interface block
array.
This patch can make the implementation of Geometry Shader easier
when we set array size to the built-in interface block 'gl_in' and other
user-defined unsized input interface blocks during the compilation of a
Geometry Shader.
BUG=angleproject:1941
TEST=angle_end2end_test
Change-Id: I9a51aab9b8f9ea7e88af157505c092426cee7e6e
Reviewed-on: https://chromium-review.googlesource.com/615759
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
85d624a5
|
2017-08-07T13:42:33
|
|
Fix null pointer dereference in redeclaration error message
When a function parameter name conflicts with another, the pointer
returned to ParseContext will be null.
BUG=chromium:745242
TEST=angle_unittests
Change-Id: Ie53bb06b0c6660e382d85aeda41f3a1b7df5a917
Reviewed-on: https://chromium-review.googlesource.com/603368
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
b5cc1198
|
2017-07-06T10:47:20
|
|
ES31: Add Geometry Shader layout qualifiers in GLSL compiler
This patch intends to implement Geometry Shader layout qualifiers
required in OpenGL ES 3.1 extension GL_OES_geometry_shader in ANGLE
GLSL compiler.
1. Add support to the shader type GL_GEOMETRY_SHADER_OES.
2. Implement Geometry Shader layout qualifiers in the GLSL compiler:
(1) Add support to OpenGL ES 3.1 extension "GL_OES_geometry_shader".
(2) Add validations of the input and output primitive declarations
in the Geometry Shader layout declarations.
(3) Add 'invocations' and 'max_vertices' support in the Geometry
Shader layout declarations
3. Add unit tests to cover all the new features added in this patch.
BUG=angleproject:1941
TEST=angle_unittests
Change-Id: Ie693e11f8a00dab3552626ed63e9336c7fbd3cb8
Reviewed-on: https://chromium-review.googlesource.com/560647
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
a5e693af
|
2017-07-13T16:07:26
|
|
Make unique id counter a member of TSymbolTable
This makes unique id counting thread-safe.
BUG=angleproject:624
TEST=angle_unittests
Change-Id: Ie0f2c7e574470b39750d37d2181c790bc874b275
Reviewed-on: https://chromium-review.googlesource.com/570419
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
0f68463f
|
2017-07-13T12:42:15
|
|
Clean up inserting variables to symbol table
This makes the TSymbolTable interface cleaner and prepares for making
unique id counting thread-safe.
BUG=angleproject:624
TEST=angle_unittests
Change-Id: Ief99c9fc777603de28ba1517e351bc8a00633590
Reviewed-on: https://chromium-review.googlesource.com/570418
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
daaff1cc
|
2017-07-05T18:03:26
|
|
Set correct symbol ids when referring to GLSL built-ins
The symbol ids are fetched from the symbol table. A new utility
function is added to make this more convenient.
BUG=angleproject:1490
TEST=angle_unittests, angle_end2end_tests
Change-Id: I780430e3386f6599503d8290c568ca9bc9cad147
Reviewed-on: https://chromium-review.googlesource.com/559535
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
bc58515e
|
2017-06-23T15:42:17
|
|
ES31: Add 'buffer' qualifier support in shader
This change added 'buffer' qualifier support in shader which
corresponds to ESSL 3.1 spec, session 4.3.7 'Buffer Variables'.
BUG=angleproject:1951
TEST=angle_unittests:BufferVariablesTest
Change-Id: I2ecb5317d5ea9d378a60b03f86bdae04dbd89e9f
Reviewed-on: https://chromium-review.googlesource.com/534960
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
d7ceaa16
|
2017-07-12T17:46:35
|
|
Remove TIntermSymbol::setId
The only place it was being used was when parsing array declarators.
The declarator only needs to be added to the AST when the variable
has successfully been declared, so this usage was not necessary.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I05b8851cfdebc9253c9fda8b12733f23da604ca6
Reviewed-on: https://chromium-review.googlesource.com/569160
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
3ec75686
|
2017-07-05T17:02:55
|
|
Collect AST transform utilities to a separate file
Collect static functions that are used to create nodes in AST
transformations into a single file.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I6f87422988fa088f2f4b48986e378a2909705cb7
|
|
37d96cce
|
2017-07-11T14:14:03
|
|
Fix accepting arrays as array indices
Previously, arrays were being incorrectly accepted as array indices.
This was because the isScalar() check only checked that the type was
not a vector or matrix, but still returned true for scalar arrays.
This patch changes the isScalar() check so that it returns false for
arrays. This makes usage of the term "scalar" more consistent in the
shader translator. Most of the code using isScalar() was compatible
with this change. Code in util.cpp that used to assume that isScalar()
doesn't care about arrayness is refactored to work with the new
behavior.
BUG=angleproject:2102
TEST=angle_unittests
Change-Id: I2a7f4c30fca7917d1099d0400efe3de859338b2a
|
|
56229f1b
|
2017-07-10T14:16:33
|
|
Remove TIntermediate::addConstantUnion
This includes asserts in TConstantUnion to reveal incorrect usage of
union - reading a different field of an union that has last been set
is undefined behavior in C++.
Existing issues with accessing incorrect fields of constant unions
are fixed.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: Idd6b7a871d73e2928f117a9348c92043612fab82
|
|
eb7f90fd
|
2017-07-07T17:25:23
|
|
Remove simple Intermediate.h functions
Most of the functions were just simple wrappers around node
constructors. Dropping this extra redirection makes the code simpler.
The fold() functions of node types are simplified, so that if the node
can't be folded the pointer to the node itself is returned. This makes
the code in ParseContext more straightforward.
The few remaining functions in Intermediate are a bit more complex so
they should be handled separately, but they'll be removed eventually
as well.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I85e11919d1f62358cfba9c011b841e32bc25402f
Reviewed-on: https://chromium-review.googlesource.com/563393
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
d7cd4ae5
|
2017-07-06T15:52:49
|
|
Check that function declarations don't use a reserved name
Reserved function names are now caught if the function is just
declared without being called in the shader source. Actually, function
calls don't need to be checked for reserved names, since that just
generates a redundant error message if function declarations are being
checked.
Includes some cleanup of ParseContext::checkIsNotReserved. It doesn't
need special handling of built-in symbols, as they are never passed to
the function.
BUG=chromium:739448
TEST=angle_unittests
Change-Id: I7115e1a7509626b5109b5c054c0704b0c3c19c58
Reviewed-on: https://chromium-review.googlesource.com/561457
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
cce8965d
|
2017-06-19T16:04:09
|
|
Remove most of the remaining logic from glslang.y
Move most of the logic in glslang.y to ParseContext. This will make it
easier to change the code in the future.
Only a few specific bits of logic are kept in glslang.y:
* Disabling a parsing rule when a given shading language version is
being parsed. This makes it easier to check the grammar against the
grammar in the GLSL ES specs.
* Scoping calls that need to be paired with another call. It's much
easier to check these for correctness when the paired calls are next
to each other.
BUG=angleproject:911
TEST=angle_unittests
Change-Id: I52f42a1fc0f28463ca4b237dc6e88345e5173064
Reviewed-on: https://chromium-review.googlesource.com/539640
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
914b79a6
|
2017-06-19T16:03:19
|
|
Fix parsing GLSL loop conditions that declare a variable
Now the variable declaration is included in the AST, so that the loop
body may refer to the variable. The variable declaration is placed in
a block that wraps the loop. This way we can still only have
TIntermTyped loop conditions in the AST, which keeps the code dealing
with loops fairly simple and type safe.
This change includes reversing the return value of executeInitializer,
so that it returns true on success and false on error. This is more in
line with other ParseContext member functions.
BUG=angleproject:2073
TEST=angle_end2end_tests
Change-Id: I5c4ecbf1b438d3fff6d6237c0dcf191e2a19664c
Reviewed-on: https://chromium-review.googlesource.com/539639
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
4cdac9eb
|
2017-05-08T11:01:20
|
|
ES31: Add atomic counter for GLSL parsing
This makes shader compiler support the new basic type 'atomic_uint'
and validate its layout qualifiers properly.
BUG=angleproject:1729
TEST=angle_unittests:AtomicCounterTest
angle_deqp_gles31_tests:dEQP-GLES31.functional.atomic_counter.layout.invalid*
angle_deqp_gles31_tests:dEQP-GLES31.functional.debug.negative_coverage.*.atomic*
Change-Id: Ia237eadf6ea72314f436a0abbb93a05598e71eba
Reviewed-on: https://chromium-review.googlesource.com/500088
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
af713a24
|
2017-04-19T09:10:56
|
|
ES31: Implement binding layout for uniform blocks
The binding point of uniform blocks can be specified in shaders with
this CL. See spec ESSL 3.10, section 4.4.4, page 58 for more info.
dEQP-GLES31.functional.ubo.* still can't completely pass as
the missing of arrays-of-arrays feature. Neither can
dEQP-GLES31.functional.layout_binding.ubo.* due to the incomplete
implementation of program interface APIs.
TEST=angle_end2end_tests:UniformBufferTest
BUG=angleproject:1442
Change-Id: If95d468fc109834a132b9b817730d3fdc3a615da
Reviewed-on: https://chromium-review.googlesource.com/483848
Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
95468d17
|
2017-05-04T11:14:34
|
|
Support multiview in ESSL 1.00 shaders
Support is added according to the proposal for WEBGL_multiview. When
the multiview extension is enabled in an ESSL 1.00 shader, num_views
can be specified using a layout qualifier. To support this, enabling
the multiview extension makes "layout" a keyword rather than an
identifier in ESSL 1.00.
The type of gl_ViewID_OVR is also different in case of ESSL 1.00: it
has to be a signed integer, since unsigned integers are not supported
in ESSL 1.00.
Some existing tests for multiview shaders are extended in this patch.
The changes make sure that vertex shader "in" qualifier is still
allowed in ESSL 3.00 multiview shaders, since this patch adds code to
disallow it in ESSL 1.00 multiview shaders.
BUG=angleproject:1669
TEST=angle_unittests
Change-Id: I65dbbbebabdb24cf0bb647d40aa80cebf713c4f7
Reviewed-on: https://chromium-review.googlesource.com/506088
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
487b63ab
|
2017-05-23T15:55:09
|
|
Disallow structs as scalar/vector constructor arguments
The spec isn't very explicit about disallowing this, but conversions
from structs are not among the conversion constructors or specified
in any other way either.
BUG=angleproject:2036
TEST=angle_unittests
Change-Id: I23f2ceda1d1348cec0d3bba38a7a013275ff84eb
Reviewed-on: https://chromium-review.googlesource.com/514002
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
e01c02b6
|
2017-05-08T14:41:49
|
|
Clean up ternary op validation
Use "?:" as the operator string to make the error message clearer.
Update some comments to refer to specific revisions of the spec, since
there have been some spec changes in this area.
BUG=angleproject:2032
Change-Id: Ic5d128391bfa46187ad335228077f5eab9eac349
Reviewed-on: https://chromium-review.googlesource.com/500270
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
9405005f
|
2017-05-08T14:17:44
|
|
Disallow interface blocks in arithmetic expressions
Interface blocks were mistakenly being allowed in some types of unary,
binary and ternary expressions, when they should not have been.
BUG=angleproject:2030
TEST=angle_unittests
Change-Id: Ie75833ee208e1b7fef8f77fa91b90da278bc6498
Reviewed-on: https://chromium-review.googlesource.com/500269
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
a7ecec38
|
2017-05-08T17:43:55
|
|
GLSL: Simplify constructor parsing
Constructor argument checking rules are reorganized to make them
easier to understand and constructor node creation is made simpler.
This removes usage of constructor op codes from ParseContext. This
paves the way for getting rid of constructor op codes entirely, which
will remove duplicate information from the AST and simplify lots of
code.
This refactoring will make adding arrays of arrays slightly easier.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I4053afec55111b629353b4ff7cb0451c1ae3511c
Reviewed-on: https://chromium-review.googlesource.com/498767
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
b4cf5656
|
2017-05-05T18:51:17
|
|
Validate opaque operands against binary operators
Add checks that opaque operands can only be used with array indexing
and field section, as mentioned in ESSL 3.10 section 4.1.7.
BUG=angleproject:2028
Change-Id: I41b7f10785bf712dfc999f85ebff925341c51911
Reviewed-on: https://chromium-review.googlesource.com/497767
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
cc2a10e9
|
2017-05-03T14:05:12
|
|
Unify opaque type validation in GLSL parsing
Refactor separate sampler and image validations into unified opaque
type handling. This paves way for adding atomic counter, another
new opaque type.
BUG=angleproject:1729
Change-Id: I201d28e31c84534db43e656d518650e378bab76c
Reviewed-on: https://chromium-review.googlesource.com/493618
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
|
|
7142f6ce
|
2017-05-05T17:07:26
|
|
Prevent using gl_ViewID_OVR as an l-value
It's a shader input and as such should not be writable.
BUG=angleproject:1669
TEST=angle_unittests
Change-Id: I05cb5c63b7272dfa6e80cad57385da02504e4d8f
Reviewed-on: https://chromium-review.googlesource.com/497408
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
bb7e5a7c
|
2017-04-24T10:16:44
|
|
GLSL parser: Fix empty declaration qualifier checks
The shader validation now does the same checks for qualifier
combinations regardless of if a declaration is empty, as is specified.
Some of these checks used to be in singleDeclarationErrorCheck, and
have now been moved to a new function declarationQualifierErrorCheck.
The other parts of singleDeclarationErrorCheck are under a renamed
nonEmptyDeclarationErrorCheck.
The patch also contains another related cleanup: Unnecessary symbol
nodes won't be created for empty declarations any more.
BUG=angleproject:2020
TEST=angle_unittests
Change-Id: I1c864a5e151c52703926d8c550450b2561bfcbb2
Reviewed-on: https://chromium-review.googlesource.com/493227
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
4f285443
|
2017-04-21T12:15:49
|
|
Refactoring: replace NULL by nullptr for pointers (2nd CL).
This CL mainly handles the pointer comparisons (== or !=).
BUG=angleproject:2001
Change-Id: I25ac3b61032e7ad91459a1c6541cadc87cf9b160
Reviewed-on: https://chromium-review.googlesource.com/483935
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
d7297bfb
|
2017-04-19T15:27:10
|
|
Code refactoring: replace NULL by nullptr for pointers.
This is the frist change to replace NULL by nullptr.
It handles the initialization and assignment for pointers.
BUG=angleproject:2001
Change-Id: I6d4bb198a72e38b867cd2f65a6e6f2f61339a0b5
Reviewed-on: https://chromium-review.googlesource.com/481600
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
ec9232bd
|
2017-03-27T17:01:37
|
|
Store unmangled function names in the AST
This makes the code simpler across the board. There are a few cases
where mangled names still need to be generated in AST traversers, but
they are outweighed by much leaner output code for all function nodes.
BUG=angleproject:1490
TEST=angle_unittests, angle_end2end_tests
Change-Id: Id3638e0fca6019bbbe6fc5e1b7763870591da2d8
Reviewed-on: https://chromium-review.googlesource.com/461077
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
fe48632f
|
2017-03-21T09:30:54
|
|
Prefer identifying functions by using symbol ids
The shader translator code is now structured in a way that ensures
that all function definition, function prototype and function call
nodes store the integer symbol id for the function. This is guaranteed
regardless of whether the function node is added while parsing or as a
result of an AST transformation. TIntermAggregate nodes, which include
function calls and constructors can now only be created by calling one
of the TIntermAggregate::Create*() functions to ensure they have all
the necessary properties.
This makes it possible to keep track of functions using integer ids
instead of their mangled name strings when generating the call graph
and when using TLValueTrackingTraverser.
This commit includes a few other small cleanups to the CallDAG class
as well.
BUG=angleproject:1490
TEST=angle_unittests, angle_end2end_tests
Change-Id: Idd1013506cbe4c3380e20d90524a9cd09b890259
Reviewed-on: https://chromium-review.googlesource.com/459603
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|