KroMignon / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 1 forks source link

Implement support for array constructors in the ESSL3 compiler #941

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The ESSL3 compiler needs to support array constructors. This includes parsing 
constructors like float[3](); and also float[](); where the size of the array 
is implicit.

Original issue reported on code.google.com by oetu...@nvidia.com on 10 Mar 2015 at 12:23

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Olli Etuaho <oetuaho@nvidia.com>
Commit : 2728eda4bc1d9aa3ac34c610b307c66660dc2376

Code-Review  0 : Olli Etuaho, Zhenyao Mo
Code-Review  +1: Jamie Madill
Code-Review  +2: Nicolas Capens
Verified     0 : Jamie Madill, Nicolas Capens, Zhenyao Mo
Verified     +1: Olli Etuaho
Commit Queue   : Chumped
Change-Id      : I55476483c9e83241e8978cd58f05ef303c7c8680
Reviewed-at    : https://chromium-review.googlesource.com/260260

Revert "A special state to track field selection is not necessary."

This reverts commit f8dc4fb66d2ee473b6ba37626f02756422863f6c.

The special state to track field selection is actually necessary to avoid
reduce/reduce conflicts when array constructors are added to the grammar.

BUG=angleproject:941
TEST=WebGL conformance tests, angle_unittests

src/compiler/translator/glslang.l
src/compiler/translator/glslang.y
src/compiler/translator/glslang_lex.cpp
src/compiler/translator/glslang_tab.cpp

Original comment by bugdro...@chromium.org on 16 Mar 2015 at 3:37

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Olli Etuaho <oetuaho@nvidia.com>
Commit : d6b1428771146333d65473e2638693b579b6b2e7

Code-Review  0 : Nicolas Capens, Olli Etuaho, Zhenyao Mo
Code-Review  +2: Jamie Madill
Verified     0 : Jamie Madill, Nicolas Capens, Zhenyao Mo
Verified     +1: Olli Etuaho
Commit Queue   : Chumped
Change-Id      : If1de33ea250893527be7f0d7930d4678a0864684
Reviewed-at    : https://chromium-review.googlesource.com/260571

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

src/compiler/translator/IntermNode.cpp
src/compiler/translator/ParseContext.cpp
src/compiler/translator/ParseContext.h
src/compiler/translator/glslang.y
src/compiler/translator/glslang_tab.cpp

Original comment by bugdro...@chromium.org on 19 Mar 2015 at 4:20

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Olli Etuaho <oetuaho@nvidia.com>
Commit : e79904c37c361bc689c86565ccea01575a7fdd2f

Code-Review  0 : Nicolas Capens, Olli Etuaho, Zhenyao Mo
Code-Review  +2: Jamie Madill
Verified     0 : Jamie Madill, Nicolas Capens, Zhenyao Mo
Verified     +1: Olli Etuaho
Commit Queue   : Chumped
Change-Id      : I728d511ab07af94bc3382dc2796c1e9ac79d1442
Reviewed-at    : https://chromium-review.googlesource.com/260801

Accept equality and assignment for arrays in parsing

This is enough to support the operations in GLSL output. HLSL output will
likely require additional work to support this.

BUG=angleproject:941

src/compiler/translator/IntermNode.cpp
src/compiler/translator/OutputHLSL.cpp
src/compiler/translator/ParseContext.cpp

Original comment by bugdro...@chromium.org on 19 Mar 2015 at 4:59

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Olli Etuaho <oetuaho@nvidia.com>
Commit : 7fb4955da9f760766918abc640c95ebcd41caee4

Code-Review  0 : Olli Etuaho, Zhenyao Mo
Code-Review  +1: Jamie Madill
Code-Review  +2: Nicolas Capens
Verified     0 : Jamie Madill, Nicolas Capens, Zhenyao Mo
Verified     +1: Olli Etuaho
Commit Queue   : Chumped
Change-Id      : Ie2ca7c016a3f0bcb3392a96d6d20d6f803d28bf0
Reviewed-at    : https://chromium-review.googlesource.com/261530

Support array equality operator in HLSL output

This requires adding functions to the shader source that can do the
comparison for a specific array size.

There's no automated test coverage specifically for this functionality,
since all deqp tests that cover this also require array constructors to
be supported. The change has been tested by manually inspecting shader
output. No regressions were seen in automated tests listed below.

TEST=dEQP-GLES3.functional.shaders.*, angle_unittests
BUG=angleproject:941

src/compiler/translator/OutputHLSL.cpp
src/compiler/translator/OutputHLSL.h

Original comment by bugdro...@chromium.org on 25 Mar 2015 at 3:49