Title: [144833] trunk/Source
Revision
144833
Author
k...@google.com
Date
2013-03-05 15:50:06 -0800 (Tue, 05 Mar 2013)

Log Message

Upgrade ANGLE to r1987
https://bugs.webkit.org/show_bug.cgi?id=111381

Reviewed by Dean Jackson.

Source/ThirdParty/ANGLE:

* include/GLSLANG/ShaderLang.h:
* src/common/version.h:
* src/compiler/Compiler.cpp:
(TCompiler::TCompiler):
(TCompiler::Init):
(TCompiler::compile):
* src/compiler/ParseHelper.h:
(TParseContext):
* src/compiler/ShHandle.h:
(TCompiler):
* src/compiler/ShaderLang.cpp:
(ShInitBuiltInResources):
* src/compiler/UnfoldShortCircuit.cpp:
(sh::UnfoldShortCircuit::visitSelection):
* src/compiler/glslang.l:
* src/compiler/glslang.y:
* src/compiler/glslang_lex.cpp:
(glslang_scan):
* src/compiler/glslang_tab.cpp:
     Updated ANGLE to r1987.

Source/WebCore:

Covered by existing tests. Ran WebGL conformance tests in Safari
to ensure correct operation of patch.

* platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
* platform/graphics/efl/GraphicsContext3DEfl.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D):
* platform/graphics/qt/GraphicsContext3DQt.cpp:
(WebCore::GraphicsContext3DPrivate::initializeANGLE):
    Changed all ports to query for highp support in fragment
    shaders and conditionally enable it in ANGLE shader translator.

Modified Paths

Diff

Modified: trunk/Source/ThirdParty/ANGLE/ChangeLog (144832 => 144833)


--- trunk/Source/ThirdParty/ANGLE/ChangeLog	2013-03-05 23:46:11 UTC (rev 144832)
+++ trunk/Source/ThirdParty/ANGLE/ChangeLog	2013-03-05 23:50:06 UTC (rev 144833)
@@ -1,3 +1,31 @@
+2013-03-05  Kenneth Russell  <k...@google.com>
+
+        Upgrade ANGLE to r1987
+        https://bugs.webkit.org/show_bug.cgi?id=111381
+
+        Reviewed by Dean Jackson.
+
+        * include/GLSLANG/ShaderLang.h:
+        * src/common/version.h:
+        * src/compiler/Compiler.cpp:
+        (TCompiler::TCompiler):
+        (TCompiler::Init):
+        (TCompiler::compile):
+        * src/compiler/ParseHelper.h:
+        (TParseContext):
+        * src/compiler/ShHandle.h:
+        (TCompiler):
+        * src/compiler/ShaderLang.cpp:
+        (ShInitBuiltInResources):
+        * src/compiler/UnfoldShortCircuit.cpp:
+        (sh::UnfoldShortCircuit::visitSelection):
+        * src/compiler/glslang.l:
+        * src/compiler/glslang.y:
+        * src/compiler/glslang_lex.cpp:
+        (glslang_scan):
+        * src/compiler/glslang_tab.cpp:
+             Updated ANGLE to r1987.
+
 2013-03-01  Martin Robinson  <mrobin...@igalia.com>
 
         [GTK] Add ANGLE to the GTK+ gyp build

Modified: trunk/Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h (144832 => 144833)


--- trunk/Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h	2013-03-05 23:46:11 UTC (rev 144832)
+++ trunk/Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h	2013-03-05 23:50:06 UTC (rev 144833)
@@ -37,7 +37,7 @@
 
 // Version number for shader translation API.
 // It is incremented everytime the API changes.
-#define ANGLE_SH_VERSION 108
+#define ANGLE_SH_VERSION 110
 
 //
 // The names of the following enums have been derived by replacing GL prefix
@@ -210,6 +210,10 @@
     int ARB_texture_rectangle;
     int EXT_draw_buffers;
 
+    // Set to 1 if highp precision is supported in the fragment language.
+    // Default is 0.
+    int FragmentPrecisionHigh;
+
     // Name Hashing.
     // Set a 64 bit hash function to enable user-defined name hashing.
     // Default is NULL.

Modified: trunk/Source/ThirdParty/ANGLE/src/common/version.h (144832 => 144833)


--- trunk/Source/ThirdParty/ANGLE/src/common/version.h	2013-03-05 23:46:11 UTC (rev 144832)
+++ trunk/Source/ThirdParty/ANGLE/src/common/version.h	2013-03-05 23:50:06 UTC (rev 144833)
@@ -1,7 +1,7 @@
 #define MAJOR_VERSION 1
 #define MINOR_VERSION 0
 #define BUILD_VERSION 0
-#define BUILD_REVISION 1833
+#define BUILD_REVISION 1987
 
 #define STRINGIFY(x) #x
 #define MACRO_STRINGIFY(x) STRINGIFY(x)

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp (144832 => 144833)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp	2013-03-05 23:46:11 UTC (rev 144832)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp	2013-03-05 23:50:06 UTC (rev 144833)
@@ -38,6 +38,7 @@
     // The builtins deliberately don't specify precisions for the function
     // arguments and return types. For that reason we don't try to check them.
     TParseContext parseContext(symbolTable, extBehavior, intermediate, type, spec, 0, false, NULL, infoSink);
+    parseContext.fragmentPrecisionHigh = resources.FragmentPrecisionHigh == 1;
 
     GlobalParseContext = &parseContext;
 
@@ -102,6 +103,7 @@
 TCompiler::TCompiler(ShShaderType type, ShShaderSpec spec)
     : shaderType(type),
       shaderSpec(spec),
+      fragmentPrecisionHigh(false),
       clampingStrategy(SH_CLAMP_WITH_CLAMP_INTRINSIC),
       builtInFunctionEmulator(type)
 {
@@ -125,6 +127,7 @@
     if (!InitBuiltInSymbolTable(resources))
         return false;
     InitExtensionBehavior(resources, extensionBehavior);
+    fragmentPrecisionHigh = resources.FragmentPrecisionHigh == 1;
 
     arrayBoundsClamper.SetClampingStrategy(resources.ArrayIndexClampingStrategy);
     clampingStrategy = resources.ArrayIndexClampingStrategy;
@@ -161,6 +164,7 @@
     TParseContext parseContext(symbolTable, extensionBehavior, intermediate,
                                shaderType, shaderSpec, compileOptions, true,
                                sourcePath, infoSink);
+    parseContext.fragmentPrecisionHigh = fragmentPrecisionHigh;
     GlobalParseContext = &parseContext;
 
     // We preserve symbols at the built-in level from compile-to-compile.

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/ParseHelper.h (144832 => 144833)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/ParseHelper.h	2013-03-05 23:46:11 UTC (rev 144832)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/ParseHelper.h	2013-03-05 23:50:06 UTC (rev 144833)
@@ -58,6 +58,7 @@
     const TType* currentFunctionType;  // the return type of the function that's currently being parsed
     bool functionReturnsValue;   // true if a non-void function has a return
     bool checksPrecisionErrors;  // true if an error will be generated when a variable is declared without precision, explicit or implicit.
+    bool fragmentPrecisionHigh;  // true if highp precision is supported in the fragment language.
     TString HashErrMsg;
     bool AfterEOF;
     TDiagnostics diagnostics;

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/ShHandle.h (144832 => 144833)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/ShHandle.h	2013-03-05 23:46:11 UTC (rev 144832)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/ShHandle.h	2013-03-05 23:50:06 UTC (rev 144833)
@@ -122,6 +122,7 @@
     TSymbolTable symbolTable;
     // Built-in extensions with default behavior.
     TExtensionBehavior extensionBehavior;
+    bool fragmentPrecisionHigh;
 
     ArrayBoundsClamper arrayBoundsClamper;
     ShArrayIndexClampingStrategy clampingStrategy;

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/ShaderLang.cpp (144832 => 144833)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/ShaderLang.cpp	2013-03-05 23:46:11 UTC (rev 144832)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/ShaderLang.cpp	2013-03-05 23:50:06 UTC (rev 144833)
@@ -127,6 +127,9 @@
     resources->ARB_texture_rectangle = 0;
     resources->EXT_draw_buffers = 0;
 
+    // Disable highp precision in fragment shader by default.
+    resources->FragmentPrecisionHigh = 0;
+
     // Disable name hashing by default.
     resources->HashFunction = NULL;
 

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/UnfoldShortCircuit.cpp (144832 => 144833)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/UnfoldShortCircuit.cpp	2013-03-05 23:46:11 UTC (rev 144832)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/UnfoldShortCircuit.cpp	2013-03-05 23:50:06 UTC (rev 144833)
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
@@ -111,6 +111,8 @@
 
         out << mOutputHLSL->typeString(node->getType()) << " s" << i << ";\n";
 
+        out << "{\n";
+
         mTemporaryIndex = i + 1;
         node->getCondition()->traverse(this);
         out << "if(";
@@ -135,6 +137,8 @@
         out << ";\n"
                "}\n";
 
+        out << "}\n";
+
         mTemporaryIndex = i + 1;
     }
 

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/glslang.l (144832 => 144833)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/glslang.l	2013-03-05 23:46:11 UTC (rev 144832)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/glslang.l	2013-03-05 23:50:06 UTC (rev 144833)
@@ -357,6 +357,9 @@
          iter != extBehavior.end(); ++iter) {
         context->preprocessor.predefineMacro(iter->first.c_str(), 1);
     }
+    if (context->fragmentPrecisionHigh)
+        context->preprocessor.predefineMacro("GL_FRAGMENT_PRECISION_HIGH", 1);
+
     return 0;
 }
 

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/glslang.y (144832 => 144833)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/glslang.y	2013-03-05 23:46:11 UTC (rev 144832)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/glslang.y	2013-03-05 23:50:06 UTC (rev 144833)
@@ -991,6 +991,10 @@
         $$ = $1.intermAggregate;
     }
     | PRECISION precision_qualifier type_specifier_no_prec SEMICOLON {
+        if (($2 == EbpHigh) && (context->shaderType == SH_FRAGMENT_SHADER) && !context->fragmentPrecisionHigh) {
+            context->error($1.line, "precision is not supported in fragment shader", "highp");
+            context->recover();
+        }
         if (!context->symbolTable.setDefaultPrecision( $3, $2 )) {
             context->error($1.line, "illegal type argument for default precision qualifier", getBasicString($3.type));
             context->recover();
@@ -2145,4 +2149,3 @@
 int glslang_parse(TParseContext* context) {
     return yyparse(context);
 }
-

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/glslang_lex.cpp (144832 => 144833)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/glslang_lex.cpp	2013-03-05 23:46:11 UTC (rev 144832)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/glslang_lex.cpp	2013-03-05 23:50:06 UTC (rev 144833)
@@ -3033,6 +3033,9 @@
          iter != extBehavior.end(); ++iter) {
         context->preprocessor.predefineMacro(iter->first.c_str(), 1);
     }
+    if (context->fragmentPrecisionHigh)
+        context->preprocessor.predefineMacro("GL_FRAGMENT_PRECISION_HIGH", 1);
+
     return 0;
 }
 

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/glslang_tab.cpp (144832 => 144833)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/glslang_tab.cpp	2013-03-05 23:46:11 UTC (rev 144832)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/glslang_tab.cpp	2013-03-05 23:50:06 UTC (rev 144833)
@@ -758,20 +758,20 @@
      762,   773,   777,   778,   788,   798,   808,   821,   822,   832,
      845,   849,   853,   857,   858,   871,   872,   885,   886,   899,
      900,   917,   918,   931,   932,   933,   934,   935,   939,   942,
-     953,   961,   988,   993,  1003,  1041,  1044,  1051,  1059,  1080,
-    1101,  1112,  1141,  1146,  1156,  1161,  1171,  1174,  1177,  1180,
-    1186,  1193,  1196,  1218,  1236,  1260,  1283,  1287,  1305,  1313,
-    1345,  1365,  1454,  1463,  1486,  1489,  1495,  1503,  1511,  1519,
-    1529,  1536,  1539,  1542,  1548,  1551,  1566,  1570,  1574,  1578,
-    1587,  1592,  1597,  1602,  1607,  1612,  1617,  1622,  1627,  1632,
-    1638,  1644,  1650,  1655,  1660,  1669,  1678,  1683,  1696,  1696,
-    1710,  1710,  1719,  1722,  1737,  1773,  1777,  1783,  1791,  1807,
-    1811,  1815,  1816,  1822,  1823,  1824,  1825,  1826,  1830,  1831,
-    1831,  1831,  1841,  1842,  1846,  1846,  1847,  1847,  1852,  1855,
-    1865,  1868,  1874,  1875,  1879,  1887,  1891,  1901,  1906,  1923,
-    1923,  1928,  1928,  1935,  1935,  1943,  1946,  1952,  1955,  1961,
-    1965,  1972,  1979,  1986,  1993,  2004,  2013,  2017,  2024,  2027,
-    2033,  2033
+     953,   961,   988,   993,  1007,  1045,  1048,  1055,  1063,  1084,
+    1105,  1116,  1145,  1150,  1160,  1165,  1175,  1178,  1181,  1184,
+    1190,  1197,  1200,  1222,  1240,  1264,  1287,  1291,  1309,  1317,
+    1349,  1369,  1458,  1467,  1490,  1493,  1499,  1507,  1515,  1523,
+    1533,  1540,  1543,  1546,  1552,  1555,  1570,  1574,  1578,  1582,
+    1591,  1596,  1601,  1606,  1611,  1616,  1621,  1626,  1631,  1636,
+    1642,  1648,  1654,  1659,  1664,  1673,  1682,  1687,  1700,  1700,
+    1714,  1714,  1723,  1726,  1741,  1777,  1781,  1787,  1795,  1811,
+    1815,  1819,  1820,  1826,  1827,  1828,  1829,  1830,  1834,  1835,
+    1835,  1835,  1845,  1846,  1850,  1850,  1851,  1851,  1856,  1859,
+    1869,  1872,  1878,  1879,  1883,  1891,  1895,  1905,  1910,  1927,
+    1927,  1932,  1932,  1939,  1939,  1947,  1950,  1956,  1959,  1965,
+    1969,  1976,  1983,  1990,  1997,  2008,  2017,  2021,  2028,  2031,
+    2037,  2037
 };
 #endif
 
@@ -3174,6 +3174,10 @@
   case 73:
 
     {
+        if (((yyvsp[(2) - (4)].interm.precision) == EbpHigh) && (context->shaderType == SH_FRAGMENT_SHADER) && !context->fragmentPrecisionHigh) {
+            context->error((yyvsp[(1) - (4)].lex).line, "precision is not supported in fragment shader", "highp");
+            context->recover();
+        }
         if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {
             context->error((yyvsp[(1) - (4)].lex).line, "illegal type argument for default precision qualifier", getBasicString((yyvsp[(3) - (4)].interm.type).type));
             context->recover();
@@ -4847,4 +4851,3 @@
     return yyparse(context);
 }
 
-

Modified: trunk/Source/WebCore/ChangeLog (144832 => 144833)


--- trunk/Source/WebCore/ChangeLog	2013-03-05 23:46:11 UTC (rev 144832)
+++ trunk/Source/WebCore/ChangeLog	2013-03-05 23:50:06 UTC (rev 144833)
@@ -1,3 +1,26 @@
+2013-03-05  Kenneth Russell  <k...@google.com>
+
+        Upgrade ANGLE to r1987
+        https://bugs.webkit.org/show_bug.cgi?id=111381
+
+        Reviewed by Dean Jackson.
+
+        Covered by existing tests. Ran WebGL conformance tests in Safari
+        to ensure correct operation of patch.
+
+        * platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp:
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+        * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+        * platform/graphics/efl/GraphicsContext3DEfl.cpp:
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+        * platform/graphics/mac/GraphicsContext3DMac.mm:
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+        * platform/graphics/qt/GraphicsContext3DQt.cpp:
+        (WebCore::GraphicsContext3DPrivate::initializeANGLE):
+            Changed all ports to query for highp support in fragment
+            shaders and conditionally enable it in ANGLE shader translator.
+
 2013-03-05  Alec Flett  <alecfl...@chromium.org>
 
         IndexedDB: Add IDBBackingStoreTest

Modified: trunk/Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp (144832 => 144833)


--- trunk/Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp	2013-03-05 23:46:11 UTC (rev 144832)
+++ trunk/Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp	2013-03-05 23:50:06 UTC (rev 144833)
@@ -113,6 +113,11 @@
     ANGLEResources.OES_standard_derivatives = m_extensions->supports("GL_OES_standard_derivatives");
     ANGLEResources.OES_EGL_image_external = m_extensions->supports("GL_EGL_image_external");
     ANGLEResources.ARB_texture_rectangle = m_extensions->supports("GL_ARB_texture_rectangle");
+
+    GC3Dint range[2], precision;
+    getShaderPrecisionFormat(GraphicsContext3D::FRAGMENT_SHADER, GraphicsContext3D::HIGH_FLOAT, range, &precision);
+    ANGLEResources.FragmentPrecisionHigh = (range[0] || range[1] || precision);
+
     m_compiler.setResources(ANGLEResources);
 
     ::glClearColor(0, 0, 0, 0);

Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp (144832 => 144833)


--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp	2013-03-05 23:46:11 UTC (rev 144832)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp	2013-03-05 23:50:06 UTC (rev 144833)
@@ -131,6 +131,11 @@
 
     // Always set to 1 for OpenGL ES.
     ANGLEResources.MaxDrawBuffers = 1;
+
+    GC3Dint range[2], precision;
+    getShaderPrecisionFormat(GraphicsContext3D::FRAGMENT_SHADER, GraphicsContext3D::HIGH_FLOAT, range, &precision);
+    ANGLEResources.FragmentPrecisionHigh = (range[0] || range[1] || precision);
+
     m_compiler.setResources(ANGLEResources);
 
 #if !USE(OPENGL_ES_2)

Modified: trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp (144832 => 144833)


--- trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp	2013-03-05 23:46:11 UTC (rev 144832)
+++ trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp	2013-03-05 23:50:06 UTC (rev 144833)
@@ -114,6 +114,11 @@
 
     // Always set to 1 for OpenGL ES.
     ANGLEResources.MaxDrawBuffers = 1;
+
+    GC3Dint range[2], precision;
+    getShaderPrecisionFormat(GraphicsContext3D::FRAGMENT_SHADER, GraphicsContext3D::HIGH_FLOAT, range, &precision);
+    ANGLEResources.FragmentPrecisionHigh = (range[0] || range[1] || precision);
+
     m_compiler.setResources(ANGLEResources);
 
 #if !USE(OPENGL_ES_2)

Modified: trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm (144832 => 144833)


--- trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm	2013-03-05 23:46:11 UTC (rev 144832)
+++ trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm	2013-03-05 23:50:06 UTC (rev 144833)
@@ -221,6 +221,10 @@
     // Always set to 1 for OpenGL ES.
     ANGLEResources.MaxDrawBuffers = 1;
     
+    GC3Dint range[2], precision;
+    getShaderPrecisionFormat(GraphicsContext3D::FRAGMENT_SHADER, GraphicsContext3D::HIGH_FLOAT, range, &precision);
+    ANGLEResources.FragmentPrecisionHigh = (range[0] || range[1] || precision);
+
     m_compiler.setResources(ANGLEResources);
     
     ::glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);

Modified: trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp (144832 => 144833)


--- trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp	2013-03-05 23:46:11 UTC (rev 144832)
+++ trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp	2013-03-05 23:50:06 UTC (rev 144833)
@@ -194,6 +194,10 @@
     if (extensions->supports("GL_ARB_texture_rectangle"))
         ANGLEResources.ARB_texture_rectangle = 1;
 
+    GC3Dint range[2], precision;
+    m_context->getShaderPrecisionFormat(GraphicsContext3D::FRAGMENT_SHADER, GraphicsContext3D::HIGH_FLOAT, range, &precision);
+    ANGLEResources.FragmentPrecisionHigh = (range[0] || range[1] || precision);
+
     m_context->m_compiler.setResources(ANGLEResources);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to