|
e1a94c67
|
2015-11-16T17:35:25
|
|
Check that texture offset is constant and valid
Offset passed to textureOffset and similar functions must be constant.
See ESSL 3.00 spec section 8.8.
It must also be in the valid range between MIN_PROGRAM_TEXEL_OFFSET and
MAX_PROGRAM_TEXEL_OFFSET. Using values outside the valid range makes
the results of the texture lookup undefined, as specified in GLES 3.0.4
section 3.8.10. We generate a compiler error if an offset is outside the
valid range.
BUG=angleproject:1215
TEST=angle_unittests
Change-Id: Ida28361444d2f4050d516160f1491674c31868a1
Reviewed-on: https://chromium-review.googlesource.com/312223
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
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>
|
|
1d122789
|
2015-11-06T15:35:17
|
|
Fix constructor constant folding
The previous solution for constant folding constructors was significantly
overengineered and partially incorrect. Switch to a much simpler
constructor folding function that does not use an AST traverser, but
simply iterates over the constant folded parameters of the constructor
and doesn't do any unnecessary checks. It also reuses some code for
constant folding other built-in functions.
This fixes issues with initializing constant matrices with only a single
parameter. Instead of copying the first component of the constructor
parameter all over the matrix, passing a vec4 or matrix argument now
assigns the values correctly.
BUG=angleproject:1193
TEST=angle_unittests, WebGL conformance tests
Change-Id: I50b10721ea30cb15843fba892c1b1a211f1d72e5
Reviewed-on: https://chromium-review.googlesource.com/311191
Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
7c3848e5
|
2015-11-04T13:19:17
|
|
Allow constant folding some non-constant expressions
This requires removing the assumption that constant folding implies
constness in the constant expression sense from various places in the
code.
This particularly benefits ternary operators, which can now be simplified
if just the condition is a compile-time constant.
In the future, the groundwork that is laid here could be used to implement
more aggressive constant folding of user-defined functions for example.
TEST=angle_unittests
BUG=angleproject:851
Change-Id: I0eede806570d56746c3dad1e01aa89a91d66013d
Reviewed-on: https://chromium-review.googlesource.com/310750
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
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>
|
|
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>
|
|
a6996685
|
2015-10-12T14:32:30
|
|
Automatically enable highp in fragment shaders on ESSL3
Most code using the translator already enables highp with the resources
flag when a shader spec that accepts ESSL3 is used, but for example the
shader_translator utility doesn't. This fix makes sure that highp is
always enabled when a fragment shader written in ESSL3 or newer is being
compiled. This will make shader_translator easier to use for testing
ESSL3 shaders.
BUG=541550
TEST=angle_unittests
Change-Id: Ia1911677c55f3c5d921829a8cbb808847ac8b636
Reviewed-on: https://chromium-review.googlesource.com/305190
Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
56193ce3
|
2015-08-12T15:55:09
|
|
Clean up parseMatrixFields
Applying field selection directly on matrices is not mentioned in ESSL
1.00 or 3.00 specs. Remove erroneous code that generated odd error
messages when a shader tried to apply certain kinds of field selection
on a matrix.
BUG=angleproject:1118
TEST=angle_unittests, dEQP-GLES3.functional.shaders.swizzles.*
Change-Id: I7bbf5d0cbaee3f21d20b830d904c0feef445dd78
Reviewed-on: https://chromium-review.googlesource.com/293190
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
b18609b9
|
2015-07-16T14:13:11
|
|
Implement ES 2,3 parts of EXT_blend_func_extended for shader translation
Exposes gl_SecondaryFragColor, glSecondaryFragData[] and
gl_MaxDualSourceDrawBuffers to GLES SL 1.0.
Relaxes rules for undefined output locations for GLES SL 3.0
and exposes gl_MaxDualSourceDrawBuffers.
If the output GL context is GL ES 2.0 or 3.0:
The emulation layer is expected to turn on EXT_blend_func_extended
if the output GL context supports it.
If the output GL context is GL:
The emulation layer is expected to turn on EXT_blend_func_extended
if the output GL context supports ARB_blend_func_extended or if GL
context is 3.2 or later.
If the source shader spec is GLES SL 2.0: The emulation layer is
expected to inspect the shader compilation output variables upon
linking. If output target is GL SL, the emulation layer should bind
color location 0, index 1 to "angle_SecondaryFragColor" if variable
"gl_SecondaryFragColorEXT" is used. Alternatively, emulation layer
should bind "angle_SecondaryFragData" to locations 0,1,2,3,..., all
color index 1, if "gl_SecondaryFragData" array is used.
(The caller can not bind the locations or specify output variables.)
If the source shader spec is GLES SL 3.0:
The emulation layer is expected to do location auto-resolve of the
the output variables that have undefined output locations that have
not been bound by the caller.
(The caller can not use gl_ built-ins, so nothing to do with those.)
BUG=angleproject:1085
TEST=angle_unittest
Change-Id: I5cafe205b0c29478b0dcd24aa89a7b0000f5d046
Reviewed-on: https://chromium-review.googlesource.com/287580
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Kimmo Kinnunen <kkinnunen@nvidia.com>
|
|
cc36b983
|
2015-07-10T14:14:18
|
|
Implement ESSL 3.00 shader input/output variable type rules
ESSL 3.00 allows a wider variety of types of input/output variables
than ESSL 1.00, but there are still specific restrictions on structs,
matrices and arrays.
Some of the checks need to be implemented twice: once for array syntax
where the brackets are after the type, and another time for array syntax
where the brackets are after the variable name.
This requires fixes to constant folding unit tests which were previously
incorrectly using matrix outputs in fragment shaders.
New unit tests are added for several of the rules introduced, but some
cases are also covered by dEQP.
TEST=angle_unittests, dEQP-GLES.functional.shaders.linkage.varying.rules.*
BUG=angleproject:1061
Change-Id: I655b054cfe56d376db775b96a2bb41b3ac5740b0
Reviewed-on: https://chromium-review.googlesource.com/285482
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
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>
|
|
bc99bb6b
|
2015-05-14T17:42:20
|
|
Enable more warnings on GCC and clang
BUG=angleproject:892
Change-Id: I74ca341f29b245f698d1e1ad43149a91db46817f
Reviewed-on: https://chromium-review.googlesource.com/271411
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
|
|
14e95b38
|
2015-05-07T10:10:41
|
|
translator: Reject shaders that use both FragColor+FragData.
*re-land with fix for unused var in release*
We checked this at link time in the D3D back-end, but this
restriction applies to all shaders.
TEST=dEQP-GLES2.functional.shaders.fragdata.*
BUG=angleproject:995
BUG=478572
Change-Id: I63258f4de47e658812822f31601cc235f48c0826
Reviewed-on: https://chromium-review.googlesource.com/271470
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
531e3d22
|
2015-05-15T11:01:27
|
|
Revert "translator: Reject shaders that use both FragColor+FragData."
The change introduced a warning in Windows release build.
This reverts commit b8e3a568bbd16fca1099a1b54cd82a981cd88a8e.
Change-Id: I77bbc35876043c9a164aa2665965f5189ee90052
Reviewed-on: https://chromium-review.googlesource.com/271430
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
e8675195
|
2015-05-14T15:31:36
|
|
Fix "unused private variable" warning in ParseContext
BUG=angleproject:892
Change-Id: I3d0c23f1c2d43477c8b4ff28a6db470b3491de0b
Reviewed-on: https://chromium-review.googlesource.com/271276
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
|
|
b8e3a568
|
2015-05-07T10:10:41
|
|
translator: Reject shaders that use both FragColor+FragData.
We checked this at link time in the D3D back-end, but this
restriction applies to all shaders.
TEST=dEQP-GLES2.functional.shaders.fragdata.*
BUG=angleproject:995
BUG=478572
Change-Id: I99111cc6aa05b9352693f9c3b5bc70d56c9842d4
Reviewed-on: https://chromium-review.googlesource.com/269846
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
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>
|
|
06145236
|
2015-05-13T13:10:01
|
|
Refactor style in ParseContext.h.
BUG=angleproject:995
Change-Id: I893785a068d0d5cf4afc18123896bf540e53a3e0
Reviewed-on: https://chromium-review.googlesource.com/270627
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>
|
|
d57e0db3
|
2015-04-24T15:05:08
|
|
Remove separate compilerdebug.h in favor of debug.h
This unifies the behavior across the compiler and rest of ANGLE - for
example, one can use #define ANGLE_TEST_CONFIG to disable UNIMPLEMENTED
asserts in both the compiler and the rest of ANGLE. Compiler traces from
asserts also go to the same TRACE_OUTPUT_FILE as other traces instead of
being directed through ParseContext.
The compiler build already includes the common sources, so no changes to
build config are needed.
The original version of this change was reverted due to release mode
build issues. This version adds UNUSED_ASSERTION_VARIABLE where needed.
TEST=angle_unittests, angle_end2end_tests,
dEQP-GLES3.functional.shaders.*
BUG=angleproject:983
Change-Id: I36929020a04251b8bc834fbb3c069e10128c3082
Reviewed-on: https://chromium-review.googlesource.com/267411
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
a656490d
|
2015-04-27T14:30:32
|
|
Revert "Remove separate compilerdebug.h in favor of debug.h"
Causing compile warnings in Release:
1>compiler\translator\CallDAG.cpp(238): error C2220: warning treated as error - no 'object' file generated
1>compiler\translator\CallDAG.cpp(238): warning C4189: 'op' : local variable is initialized but not referenced
1>compiler\translator\IntermNode.cpp(1495): error C2220: warning treated as error - no 'object' file generated
1>compiler\translator\IntermNode.cpp(1495): warning C4189: 'replaced' : local variable is initialized but not referenced
1>compiler\translator\IntermNode.cpp(1517): warning C4189: 'replaced' : local variable is initialized but not referenced
This reverts commit 5271025865b34685da71d0309131c5aff2e32f71.
Change-Id: Icdf1c37eef22a13d083767609ab0b0285d3dc517
Reviewed-on: https://chromium-review.googlesource.com/267359
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
52710258
|
2015-04-24T15:05:08
|
|
Remove separate compilerdebug.h in favor of debug.h
This unifies the behavior across the compiler and rest of ANGLE - for
example, one can use #define ANGLE_TEST_CONFIG to disable UNIMPLEMENTED
asserts in both the compiler and the rest of ANGLE. Compiler traces from
asserts also go to the same TRACE_OUTPUT_FILE as other traces instead of
being directed through ParseContext.
The compiler build already includes the common sources, so no changes to
build config are needed.
TEST=angle_unittests, angle_end2end_tests,
dEQP-GLES3.functional.shaders.*
BUG=angleproject:983
Change-Id: Ifca4d16f667b1e5cf9c2e7cc4139940091917a1c
Reviewed-on: https://chromium-review.googlesource.com/266993
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
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>
|
|
fa33d580
|
2015-04-09T14:33:12
|
|
Improve handling of declarator lists with empty declarations
The code previously failed to check for correctness of layout qualifiers
in case a declarator followed an empty declaration, like so:
layout(packed) uniform float, a;
Fix this by running all necessary declaration checks also for declarators
which follow an empty declaration.
structQualifierErrorCheck is merged into singleDeclarationErrorCheck.
TEST=angle_unittests, WebGL conformance tests
BUG=angleproject:969
Change-Id: Idcb0673e3bcf64087744ff0d260f51a7546f024a
Reviewed-on: https://chromium-review.googlesource.com/264812
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
2935c581
|
2015-04-08T14:32:06
|
|
Simplify code related to variable declaration
Rename nonInitErrorCheck to declareVariable to clarify that it declares
variables. Merge arrayErrorCheck with that so that logic that is common
between array and non-array declarations is only in one place. This
will simplify adding array initializer handling. This also enables
redeclaring gl_LastFragData using ESSL3 array type syntax.
Comments in executeInitializer claimed that the TVariable object was
needed for error recovery, but that was not actually true, so it can also
use the new declareVariable method. Make "variable" a local variable
instead of a parameter to executeInitializer, since the parameter was
never used by callers of the function.
TEST=angle_unittests, WebGL conformance tests
BUG=angleproject:941
Change-Id: Ie133be62afc3e1f997370803cf21cada4e738935
Reviewed-on: https://chromium-review.googlesource.com/264674
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
6ed7bbe8
|
2015-04-07T18:08:46
|
|
Clean up arrayErrorCheck
Remove some unnecessary TPublicType/TType conversions from the code, and
clean up code style. voidErrorCheck is changed to take TBasicType so that
it can be used with both TType and TPublicType.
TEST=angle_unittests
BUG=angleproject:941
Change-Id: I6f6cbc0761a4fc971299bad48864309009c54e7f
Reviewed-on: https://chromium-review.googlesource.com/264673
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
3739d235
|
2015-04-08T12:23:44
|
|
Make checking for array non-constness depend on input version
First, remove duplicate check for const qualifier on arrays. Only keep
the check inside arrayQualifierErrorCheck().
Second, ESSL3 will introduce array initializers and by extension constant
arrays, so it should allow const qualifier on arrays. These checks are
somewhat superfluous in ESSL1 as well, since the parser already checks
for missing initializers, but it's useful to keep the informative error
messages around.
Add a few tests to make sure that when the ESSL3 implementation
progresses, it still checks for missing initializers on constant arrays.
TEST=angle_unittests
BUG=angleproject:941
Change-Id: Id871c872c5b92e2a5bf81c00080ac23004916a75
Reviewed-on: https://chromium-review.googlesource.com/264671
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
f6c694bc
|
2015-03-26T14:50:53
|
|
Assign built-in function return type in promote()
This finishes the refactoring of unary math operation handling so that
IntermUnary::promote has the complete code for setting the return type of
the node.
BUG=angleproject:952
TEST=angle_unittests, WebGL conformance tests
Change-Id: I19bd8d53029e24f734c9436eceb446b37e7fcf26
Reviewed-on: https://chromium-review.googlesource.com/262416
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
69c11b5d
|
2015-03-26T12:59:00
|
|
Move validation from Intermediate::addUnaryMath to ParseContext
Intermediate should only have logic for creating node objects, validation
of parameter types belongs in ParseContext.
BUG=angleproject:952
TEST=angle_unittests, WebGL conformance tests
Change-Id: Ie90697641fabb2a837ccc4571a93616d63ea64e6
Reviewed-on: https://chromium-review.googlesource.com/262414
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
|
|
47fd36a7
|
2015-03-19T14:22:24
|
|
Move some validation from IntermBinary::promote to ParseContext
This makes the role of promote() in the system clearer and helps to make
the code more understandable, since more of the checks are in the same
logical place.
BUG=angleproject:952
TEST=angle_unittests, WebGL conformance tests
Change-Id: Idb2de927d872e46210d71cf6de06a6f8c1fc5da1
Reviewed-on: https://chromium-review.googlesource.com/260803
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
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>
|
|
fc1806e1
|
2015-03-17T13:03:11
|
|
Move most of addBinaryMath from Intermediate to ParseContext
Some type checks for binary math will be different based on the shading
language version, which is easily accessible in ParseContext. Because of
this and also for architectural simplicity it makes more sense to have
the checks in ParseContext.
BUG=angle:941
TEST=angle_unittests, WebGL conformance tests
Change-Id: I92a499f47e1cbc6a7b6391ce0fa04284803e7140
Reviewed-on: https://chromium-review.googlesource.com/260570
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
092e1a12
|
2015-03-09T07:40:11
|
|
Initialize fragmentPrecisionHigh in constructor.
This was the only field not initialized by the constructor, which
looks like an oversight.
Change-Id: If61424d574c663113a4c6d31e94b6ec13b412884
Reviewed-on: https://chromium-review.googlesource.com/257360
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
|
|
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>
|
|
a3a5cc6a
|
2015-02-13T13:12:22
|
|
Expose the IntermNode tree generated in the compiler for testing
This refactoring makes it possible for tests to access the IntermNode
tree produced by compilation by calling compileTree(). Removing
ParseContext usage from OutputHLSL has the additional benefit of better
separation between parsing and output.
BUG=angle:916
Change-Id: Ib40954832316328772a5c1dcbbe6b46b238e4e65
Reviewed-on: https://chromium-review.googlesource.com/249723
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
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>
|
|
3ae6465f
|
2015-01-26T15:51:39
|
|
Fix lots of variable shadowing in ANGLE
BUG=angle:877
Change-Id: I3df0fffb19f5ecbe439fbc2a8d6d239a5dc6b638
Reviewed-on: https://chromium-review.googlesource.com/243334
Tested-by: Austin Kinross <aukinros@microsoft.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
74cafab1
|
2015-01-23T23:17:32
|
|
Revert "Fix lots of variable shadowing in ANGLE"
Caused WebGL CTS failures on the texture-npot test:
https://www.khronos.org/registry/webgl/sdk/tests/conformance/textures/texture-npot.html
This reverts commit c67e6e9fade44ef8938724e82db11db725e9c8e5.
Change-Id: I089e99859231e0d657084ac3647257c650a9da92
Reviewed-on: https://chromium-review.googlesource.com/243041
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
|
|
c67e6e9f
|
2015-01-21T16:01:07
|
|
Fix lots of variable shadowing in ANGLE
BUG=angle:877
Change-Id: I15168ae32605b26aee08274464ffe68adb5a7e87
Reviewed-on: https://chromium-review.googlesource.com/242351
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Austin Kinross <aukinros@microsoft.com>
|
|
853dc1ab
|
2014-11-06T17:25:48
|
|
Add mediump and lowp precision emulation support for GLSL output
This implements the rounding as specified in WEBGL_debug_shader_precision
extension proposal for desktop GLSL and ESSL output. The bulk of the new
functionality is added in the form of a new EmulatePrecision AST
traverser, which inserts calls to the rounding routines angle_frm and
angle_frl in the appropriate places, and writes the rounding routines
themselves to the shader.
Compound assignments which are subject to emulation are transformed from
"x op= y" to "angle_compound_op_frm(x, y)", a call to a function which
does the appropriate rounding and places the result of the operation to
x.
The angle_ prefixed names should not clash with user-defined names if
name hashing is on. If name hashing is not on, the precision emulation
can only be used if the angle_ prefix is reserved for use by ANGLE.
To support the rounding routines in output, a new operator type is added
for internal helper function calls, which are not subject to name
hashing.
In ESSL output, all variables are forced to highp when precision
emulation is on to ensure consistency with how precision emulation
performs on desktop.
Comprehensive tests for the added code generation are included.
BUG=angle:787
Change-Id: I0d0ad9327888f803a32e79b64b08763c654c913b
Reviewed-on: https://chromium-review.googlesource.com/229631
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
0a73dd85
|
2014-11-19T16:18:08
|
|
Fix include guards.
BUG=angle:733
Change-Id: I08b2c11c4831f1161c178c1842b10e807185aced
Reviewed-on: https://chromium-review.googlesource.com/230831
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
|
|
21203702
|
2014-11-13T16:16:21
|
|
Fix precision tracking of constructor return values
Precision should be set for constructor return values if they are of a
built-in type. Structs should not be precision qualified.
BUG=angle:787
Change-Id: Ie5efd5be25a788ff6f01c5b989254572c00231eb
Reviewed-on: https://chromium-review.googlesource.com/229560
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
94ac7b78
|
2014-10-15T18:22:08
|
|
Invariant related processing.
* Fix a bug in PreProcessor for STDGL pragma.
* Record all invariant settings and set them in ShaderVariable.
* Write #pragma STDGL invariant(all) in GL
BUG=angle:776
TEST=https://www.khronos.org/registry/webgl/sdk/tests/conformance/glsl/misc/shaders-with-invariance.html
Change-Id: Ie28b75480deed79f0c9f26e3b98f1778d1290182
Reviewed-on: https://chromium-review.googlesource.com/223610
Tested-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@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>
|
|
b1a85f48
|
2014-08-19T15:23:24
|
|
Rename compiler intermediate source files.
This prevents confusion between "TIntermediate" and "TIntermNode".
BUG=angle:711
Change-Id: Ib7a086382a479db3f77bf2ab06ce321aa7b35d13
Reviewed-on: https://chromium-review.googlesource.com/212936
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Nicolas Capens <capn@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>
|
|
d4a3a317
|
2014-06-25T16:04:56
|
|
Rename ShHandle.h to Compiler.h.
Since the above source file matches Compiler.cpp, more closely
follow our standard naming convention.
BUG=angle:466
Change-Id: Ib1422f87f16097f91f2bcdad550ec5bd940ce711
Reviewed-on: https://chromium-review.googlesource.com/204681
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
16004fca
|
2014-06-11T11:29:11
|
|
Eliminate conversion operations.
They've been replaced by using constructor nodes, so any code handling conversion operators
can be removed.
BUG=380353
Change-Id: I70413179e7443efccbf997a5dd0f053c23689589
Reviewed-on: https://chromium-review.googlesource.com/203453
Tested-by: Nicolas Capens <nicolascapens@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
6b9cb259
|
2013-10-17T10:45:47
|
|
Rename ParseHelper.cpp/h to ParseContext.cpp/h.
TRAC #24002
Signed-off-by: Shannon Woods
Signed-off-by: Geoff Lang
|