[WebGL] Fix crash when glsl expressions are too complex.
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Jul 2014 20:29:42 +0000 (20:29 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Jul 2014 20:29:42 +0000 (20:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=134554
<rdar://problem/17540462>

Reviewed by Dean Jackson.

This fixes the Khronos test conformance/glsl/bugs/long-expressions-should-not-crash.html.

* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE):
Add SH_LIMIT_EXPRESSION_COMPLEXITY to the ANGLE compile options.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170718 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp

index 0a83b03..9172908 100644 (file)
@@ -1,3 +1,17 @@
+2014-07-02  Alex Christensen  <achristensen@webkit.org>
+
+        [WebGL] Fix crash when glsl expressions are too complex.
+        https://bugs.webkit.org/show_bug.cgi?id=134554
+        <rdar://problem/17540462>
+
+        Reviewed by Dean Jackson.
+        
+        This fixes the Khronos test conformance/glsl/bugs/long-expressions-should-not-crash.html.
+
+        * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
+        (WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE):
+        Add SH_LIMIT_EXPRESSION_COMPLEXITY to the ANGLE compile options.
+
 2014-07-02  Benjamin Poulain  <benjamin@webkit.org>
 
         WebCore JIT: rename registerCount to something less generic and add new types for lists of registers and lists of stack references
index 003396c..5c6fe6d 100644 (file)
@@ -187,7 +187,7 @@ String Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE(Platform3DObject
 
     String translatedShaderSource;
     String shaderInfoLog;
-    int extraCompileOptions = SH_CLAMP_INDIRECT_ARRAY_BOUNDS | SH_UNFOLD_SHORT_CIRCUIT | SH_ENFORCE_PACKING_RESTRICTIONS | SH_INIT_VARYINGS_WITHOUT_STATIC_USE;
+    int extraCompileOptions = SH_CLAMP_INDIRECT_ARRAY_BOUNDS | SH_UNFOLD_SHORT_CIRCUIT | SH_ENFORCE_PACKING_RESTRICTIONS | SH_INIT_VARYINGS_WITHOUT_STATIC_USE | SH_LIMIT_EXPRESSION_COMPLEXITY;
 
     if (m_requiresBuiltInFunctionEmulation)
         extraCompileOptions |= SH_EMULATE_BUILT_IN_FUNCTIONS;