KalebDark / angleproject

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

Selectively enable [[flatten]] workaround only when required #937

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This should fix some bugs in some more complicated shaders.

Original issue reported on code.google.com by jmad...@chromium.org on 5 Mar 2015 at 10:26

GoogleCodeExporter commented 9 years ago

Original comment by jmad...@chromium.org on 5 Mar 2015 at 10:26

GoogleCodeExporter commented 9 years ago

Original comment by jmad...@chromium.org on 5 Mar 2015 at 10:27

GoogleCodeExporter commented 9 years ago

Original comment by jmad...@chromium.org on 9 Mar 2015 at 3:29

GoogleCodeExporter commented 9 years ago
The implementation of the fix tries to match the mangled names of function 
prototypes and function calls, which do not match in the case shown in issue 936

Original comment by cwal...@chromium.org on 12 Mar 2015 at 5:51

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Corentin Wallez <cwallez@chromium.org>
Commit : b34d1d12969496b1b0fb53934b8ce3200304f900

Code-Review  0 : Corentin Wallez, Jamie Madill
Code-Review  +2: Corentin Wallez, Nicolas Capens
Verified     0 : Corentin Wallez, Jamie Madill, Nicolas Capens
Verified     +1: Corentin Wallez
Commit Queue   : Chumped
Change-Id      : I643e0ed605ad095e4fd7da4977d842be5e6a12e0
Reviewed-at    : https://chromium-review.googlesource.com/229352

Implemented a CallDAG to allow for more AST analysis

The CallDAG preprocesses the AST to construct a DAG of
functions that can be used for several analysis.
Use it to implement check for recursion and max call
depth. It will also be used to limit the usage of
[[flatten]] and [[unroll]].

BUG=angleproject:937
BUG=395048

src/compiler.gypi
src/compiler/translator/CallDAG.cpp
src/compiler/translator/CallDAG.h
src/compiler/translator/Compiler.cpp
src/compiler/translator/Compiler.h
src/compiler/translator/DetectCallDepth.cpp
src/compiler/translator/DetectCallDepth.h
src/compiler/translator/IntermNode.h
src/compiler/translator/ParseContext.cpp
src/compiler/translator/glslang.y
src/compiler/translator/glslang_tab.cpp

Original comment by bugdro...@chromium.org on 2 Apr 2015 at 6:01

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Corentin Wallez <cwallez@chromium.org>
Commit : f30a9ba96bdfa014fc182060c714a2c75451f4cf

Code-Review  0 : Jamie Madill, Nicolas Capens
Code-Review  +2: Corentin Wallez
Verified     0 : Jamie Madill, Nicolas Capens
Verified     +1: Corentin Wallez
Commit Queue   : Chumped
Change-Id      : Icc37abf51a1407c9e7bc708dc08d3ba4050a496a
Reviewed-at    : https://chromium-review.googlesource.com/261189

Implement discontinuous loops AST analysis

This will allow narrowing down which usages of
[[flatten]] and [[unroll]] are actually useful.

BUG=angleproject:937
BUG=395048

src/compiler/translator/ASTMetadataHLSL.cpp
src/compiler/translator/ASTMetadataHLSL.h

Original comment by bugdro...@chromium.org on 2 Apr 2015 at 6:02

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Corentin Wallez <cwallez@chromium.org>
Commit : 2fc57a2ace58b7ae3106344c56be94948f761b2a

Code-Review  0 : Jamie Madill
Code-Review  +2: Corentin Wallez, Nicolas Capens
Verified     0 : Jamie Madill, Nicolas Capens
Verified     +1: Corentin Wallez
Commit Queue   : Chumped
Change-Id      : Ic31e434c7b5bb6c32eff2336e5949391bfee25a5
Reviewed-at    : https://chromium-review.googlesource.com/260930

Implement gradient operation AST analysis

This will allow narrowing down which usages of
[[flatten]] and [[unroll]] are actually useful.

BUG=angleproject:937
BUG=395048

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

Original comment by bugdro...@chromium.org on 2 Apr 2015 at 6:02

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Corentin Wallez <cwallez@chromium.org>
Commit : b34d1d12969496b1b0fb53934b8ce3200304f900

Code-Review  0 : Corentin Wallez, Jamie Madill, Olli Etuaho
Code-Review  +2: Corentin Wallez, Nicolas Capens
Verified     0 : Corentin Wallez, Jamie Madill, Nicolas Capens, Olli Etuaho
Verified     +1: Corentin Wallez
Commit Queue   : Chumped
Change-Id      : I643e0ed605ad095e4fd7da4977d842be5e6a12e0
Reviewed-at    : https://chromium-review.googlesource.com/229352

Implemented a CallDAG to allow for more AST analysis

The CallDAG preprocesses the AST to construct a DAG of
functions that can be used for several analysis.
Use it to implement check for recursion and max call
depth. It will also be used to limit the usage of
[[flatten]] and [[unroll]].

BUG=angleproject:937
BUG=395048

src/compiler.gypi
src/compiler/translator/CallDAG.cpp
src/compiler/translator/CallDAG.h
src/compiler/translator/Compiler.cpp
src/compiler/translator/Compiler.h
src/compiler/translator/DetectCallDepth.cpp
src/compiler/translator/DetectCallDepth.h
src/compiler/translator/IntermNode.h
src/compiler/translator/ParseContext.cpp
src/compiler/translator/glslang.y
src/compiler/translator/glslang_tab.cpp

Original comment by bugdro...@chromium.org on 2 Apr 2015 at 7:25

GoogleCodeExporter commented 9 years ago
There's a compilation problem with the CallDAG patches on Mac OS. Could you 
please investigate?

http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Mac%20Builder
http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Mac%20Builder%20%28d
bg%29

Thanks.

Original comment by kbr@chromium.org on 2 Apr 2015 at 7:26

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Corentin Wallez <cwallez@chromium.org>
Commit : 1239ee94fbd8163e872023d2648d58a7d17e7819

Code-Review  0 : Corentin Wallez
Code-Review  +2: Jamie Madill
Verified     0 : Jamie Madill
Verified     +1: Corentin Wallez
Commit Queue   : Chumped
Change-Id      : I856de9025f10b79781929ec212dbffc2064a940e
Reviewed-at    : https://chromium-review.googlesource.com/264791

Use the AST analyses to narrow the usage of [[loop]] and [[unroll]]

These attributes are now used exactly in the loops and ifs
that require them, limiting the number of failed compilations
due to excessive unrolling and flattening.
Also output Lod0 functions only when needed.

Adds unit tests for LOOP, FLATTEN and Lod0 generation.

The patch was tested against the WebGL CTS 1.0.4 for which all the
failures existed prior to this patch and seem to be unrelated to this
change. It also works correctly on the following sites that had trouble
with [[loop]] and [[unroll]]:
 * dev.miaumiau.cat/rayTracer "Skull Demo"
 * The turbulenz engine particle demo
 * Lots of ShaderToy samples (including "Volcanic" and "Metropolis")
 * Google Maps Earth mode
 * Lots of Chrome Experiments
 * Lagoa
 * madebyevan.com/webgl-water
 * SketchFab
 * Unit Tests

BUG=angleproject:937
BUG=395048

src/compiler/translator/OutputHLSL.cpp
src/compiler/translator/OutputHLSL.h
src/tests/angle_unittests.gypi
src/tests/compiler_tests/UnrollFlatten_test.cpp

Original comment by bugdro...@chromium.org on 9 Apr 2015 at 9:02

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Corentin Wallez <cwallez@chromium.org>
Commit : 4176cd64b72a44e02e7d9583aa0ff10db0584b42

Code-Review  0 : Corentin Wallez, Nicolas Capens
Code-Review  +2: Jamie Madill
Verified     0 : Jamie Madill, Nicolas Capens
Verified     +1: Corentin Wallez
Commit Queue   : Chumped
Change-Id      : Ie8e520267d594a595201cb7c2438a2202d9adf25
Reviewed-at    : https://chromium-review.googlesource.com/263745

Remove now unused DetectDiscontuinity.h/.cpp

BUG=angleproject:937
BUG=395048

src/compiler.gypi
src/compiler/translator/DetectDiscontinuity.cpp
src/compiler/translator/DetectDiscontinuity.h

Original comment by bugdro...@chromium.org on 9 Apr 2015 at 9:50

GoogleCodeExporter commented 9 years ago
Excellent work Corentin! Thanks for persevering with this.

Original comment by kbr@chromium.org on 9 Apr 2015 at 11:14

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

Code-Review  0 : Corentin Wallez, Jamie Madill, Nicolas Capens, Olli Etuaho
Code-Review  +2: Geoff Lang
Verified     0 : Corentin Wallez, Geoff Lang, Jamie Madill, Nicolas Capens
Verified     +1: Olli Etuaho
Commit Queue   : Chumped
Change-Id      : I04fdfe4733772a2a234934123bbfacf0376df562
Reviewed-at    : https://chromium-review.googlesource.com/265191

Fix issues with computing discontinuous loops

AST analysis to narrow down usage of [[loop]] and [[unroll]] failed to account
for break statements inside switch statements. Add switch statement handling.
This fixes asserts/crashes in dEQP tests.

BUG=angleproject:937
TEST=dEQP-GLES3.functional.shaders.switch.*

src/compiler/translator/ASTMetadataHLSL.cpp

Original comment by bugdro...@chromium.org on 10 Apr 2015 at 2:02

GoogleCodeExporter commented 9 years ago
Closing as Fixed.

Original comment by cwal...@chromium.org on 10 Apr 2015 at 2:37