Commit Graph
9 Commits
Author SHA1 Message Date
Jamie Madill 6654bc93f1 Fix stack overflow when parsing huge expressions.
The expression limit validation check needs to be in front
of other tree traversal to prevent stack overflows. Also,
call depths of sufficient size (80k+) could overflow the
depth check itself, necessitating an upper bound on initial
tree traversal.

This fixes crashes in the WebGL long-expressions bug test.

BUG=angle:584

Change-Id: Ib48294bf77a5923d230f237fbd63a36a5662e317
Reviewed-on: https://chromium-review.googlesource.com/191931
Reviewed-by: Zhenyao Mo <[email protected]>
Reviewed-by: Nicolas Capens <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2014-03-31 16:03:05 +00:00
Zhenyao Mo 3cdfcce86b Remove SH_MAP_LONG_VARIABLE_NAMES
We use hashing to map all variables/strcuture field names, etc,
so we no longer need this option.

Checked with Firefox and WebKit, they no longer use this option
either. Time to remove it.

Change-Id: Ie3e79b91a05258b04af419a9c42b2fd1b00e67c4
Reviewed-on: https://chromium-review.googlesource.com/189236
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Shannon Woods <[email protected]>
Tested-by: Zhenyao Mo <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/189568
2014-03-11 18:25:18 +00:00
Zhenyao Mo 550c600b99 Improvement on loop unrolling with loops indexing sampler arrays
1) Before this workaround is hardwired on mac, now we move it behind a compil
    2) Fix the issue where "break" inside the loop isn't handled while unrolled.

    BUG=338474
    TEST=webgl conformance test sampler-array-using-loop-index.html

Change-Id: I4996a42c2dea39a8a5af772c256f8e3cb383f59a
Reviewed-on: https://chromium-review.googlesource.com/188079
Reviewed-by: Zhenyao Mo <[email protected]>
Tested-by: Zhenyao Mo <[email protected]>

Conflicts:
	include/GLSLANG/ShaderLang.h
	src/compiler/translator/ValidateLimitations.cpp
Change-Id: I546197bd7df1634ebccdd380be14c3250cd56151
Reviewed-on: https://chromium-review.googlesource.com/189061
Reviewed-by: Shannon Woods <[email protected]>
Tested-by: Zhenyao Mo <[email protected]>
2014-03-07 18:59:18 +00:00
Jamie Madill 5508f39d0c Fix breaking the build with missing GetGlobalMaxTokenSize.
Because the preprocessor is used independently from the compiler,
we need a way to track max token size when we don't have access
to the parse context with the current spec.

BUG=angle:550

Change-Id: Idf5035ec2c001ee75f264151ab3c4e92f3cd44d7
Reviewed-on: https://chromium-review.googlesource.com/187140
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Shannon Woods <[email protected]>
Reviewed-by: Nicolas Capens <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2014-02-24 17:42:14 +00:00
Jamie Madill 88f6e946b9 Proper support for token max size in WebGL+ES3.
WebGL specifies a maximum token size of 256 characters, while
ES3 specifies 1024 characters. We can determine the proper max
size to support from the spec.

BUG=angle:550
Change-Id: I6aeabe8af3b6184a27b456248ce2f84f361b76e4
Reviewed-on: https://chromium-review.googlesource.com/186973
Reviewed-by: Shannon Woods <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2014-02-19 21:26:50 +00:00
Zhenyao Mo 4a667fe96e Add an option to initialize varyings without static use in vertex shaders
ANGLEBUG=554
TEST=webgl conformance test on mac: shaders-with-varyings.html
[email protected],[email protected]
[email protected],[email protected]

Change-Id: I2e692d43fb15f1cf3ade3e398020d1fedb2b32f0
Reviewed-on: https://chromium-review.googlesource.com/185922
Reviewed-by: Zhenyao Mo <[email protected]>
Tested-by: Zhenyao Mo <[email protected]>

Conflicts:
	src/common/version.h
	src/compiler/translator/Compiler.cpp
Change-Id: If7db13ef345bd6199d4ea0d7786f0de20885f2f3
Reviewed-on: https://chromium-review.googlesource.com/186144
Reviewed-by: Nicolas Capens <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Zhenyao Mo <[email protected]>
Tested-by: Zhenyao Mo <[email protected]>
2014-02-12 23:21:53 +00:00
Zhenyao Mo 7cab38b594 Add an option to unfold short circuiting in AST.
We replace "a || b" with "a ? true : b",
"a && b" with "a ? b : false".

This is to work around short circuiting bug in Mac drivers.

ANGLEBUG=482
TEST=webgl conformance tests
[email protected], [email protected]

Review URL: https://codereview.appspot.com/14529048

Conflicts:

	src/build_angle.gypi
	src/compiler/translator/Compiler.cpp

Change-Id: Ic2384a97d58f54294efcb3a012deb2007a9fc658
Reviewed-on: https://chromium-review.googlesource.com/178996
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
Tested-by: Shannon Woods <[email protected]>
2013-12-09 21:51:57 +00:00
Jamie Madill 6b9cb25980 Rename ParseHelper.cpp/h to ParseContext.cpp/h.
TRAC #24002

Signed-off-by: Shannon Woods
Signed-off-by: Geoff Lang
2013-10-17 14:48:58 -04:00
Geoff Lang 17732823f9 Moved the compiler source files into directories based on their project and added a compiler.gypi to generate the compiler projects. 2013-10-17 09:36:59 -04:00