Revert "Implement gl_FragDepth for GLES SL 3.0"

assertion failures in WebGL2 CTS.

This reverts commit 544809610a131fe7040f2212789c62e212bbaf24.

Change-Id: I2e0c7045c5b6ef9031a6e6c5916504fe68f51077
Reviewed-on: https://chromium-review.googlesource.com/287910
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/compiler/translator/BaseTypes.h b/src/compiler/translator/BaseTypes.h
index 5d07464..e43c236 100644
--- a/src/compiler/translator/BaseTypes.h
+++ b/src/compiler/translator/BaseTypes.h
@@ -290,18 +290,18 @@
 //
 enum TQualifier
 {
-    EvqTemporary,   // For temporaries (within a function), read/write
-    EvqGlobal,      // For globals read/write
-    EvqConst,       // User defined constants and non-output parameters in functions
-    EvqAttribute,   // Readonly
-    EvqVaryingIn,   // readonly, fragment shaders only
-    EvqVaryingOut,  // vertex shaders only  read/write
-    EvqUniform,     // Readonly, vertex and fragment
+    EvqTemporary,     // For temporaries (within a function), read/write
+    EvqGlobal,        // For globals read/write
+    EvqConst,         // User defined constants and non-output parameters in functions
+    EvqAttribute,     // Readonly
+    EvqVaryingIn,     // readonly, fragment shaders only
+    EvqVaryingOut,    // vertex shaders only  read/write
+    EvqUniform,       // Readonly, vertex and fragment
 
-    EvqVertexIn,     // Vertex shader input
-    EvqFragmentOut,  // Fragment shader output
-    EvqVertexOut,    // Vertex shader output
-    EvqFragmentIn,   // Fragment shader input
+    EvqVertexIn,      // Vertex shader input
+    EvqFragmentOut,   // Fragment shader output
+    EvqVertexOut,     // Vertex shader output
+    EvqFragmentIn,    // Fragment shader input
 
     // parameters
     EvqIn,
@@ -324,22 +324,21 @@
     // built-ins written by fragment shader
     EvqFragColor,
     EvqFragData,
-    EvqFragDepthEXT,  // gl_FragDepthEXT for ESSL100, EXT_frag_depth.
-    EvqFragDepth,     // gl_FragDepth for ESSL300.
+    EvqFragDepth,
 
     // built-ins written by the shader_framebuffer_fetch extension(s)
     EvqLastFragColor,
     EvqLastFragData,
 
     // GLSL ES 3.0 vertex output and fragment input
-    EvqSmooth,  // Incomplete qualifier, smooth is the default
-    EvqFlat,    // Incomplete qualifier
+    EvqSmooth,        // Incomplete qualifier, smooth is the default
+    EvqFlat,          // Incomplete qualifier
     EvqSmoothOut = EvqSmooth,
-    EvqFlatOut   = EvqFlat,
-    EvqCentroidOut,  // Implies smooth
+    EvqFlatOut = EvqFlat,
+    EvqCentroidOut,   // Implies smooth
     EvqSmoothIn,
     EvqFlatIn,
-    EvqCentroidIn,  // Implies smooth
+    EvqCentroidIn,    // Implies smooth
 
     // end of list
     EvqLast
@@ -389,7 +388,7 @@
 inline const char* getQualifierString(TQualifier q)
 {
     switch(q)
-    { // clang-format off
+    {
     case EvqTemporary:      return "Temporary";      break;
     case EvqGlobal:         return "Global";         break;
     case EvqConst:          return "const";          break;
@@ -413,7 +412,6 @@
     case EvqPointCoord:     return "PointCoord";     break;
     case EvqFragColor:      return "FragColor";      break;
     case EvqFragData:       return "FragData";       break;
-    case EvqFragDepthEXT:   return "FragDepth";      break;
     case EvqFragDepth:      return "FragDepth";      break;
     case EvqLastFragColor:  return "LastFragColor";  break;
     case EvqLastFragData:   return "LastFragData";   break;
@@ -424,7 +422,7 @@
     case EvqFlatIn:         return "flat in";        break;
     case EvqCentroidIn:     return "centroid in";    break;
     default: UNREACHABLE(); return "unknown qualifier";
-    } // clang-format on
+    }
 }
 
 inline const char* getMatrixPackingString(TLayoutMatrixPacking mpq)
diff --git a/src/compiler/translator/Initialize.cpp b/src/compiler/translator/Initialize.cpp
index ef7a2d9..6cb2e22 100644
--- a/src/compiler/translator/Initialize.cpp
+++ b/src/compiler/translator/Initialize.cpp
@@ -504,18 +504,10 @@
 
             if (resources.EXT_frag_depth)
             {
-                symbolTable.insert(
-                    ESSL1_BUILTINS, "GL_EXT_frag_depth",
-                    new TVariable(
-                        NewPoolTString("gl_FragDepthEXT"),
-                        TType(EbtFloat, resources.FragmentPrecisionHigh ? EbpHigh : EbpMedium,
-                              EvqFragDepthEXT, 1)));
+                symbolTable.insert(ESSL1_BUILTINS, "GL_EXT_frag_depth", new TVariable(NewPoolTString("gl_FragDepthEXT"),
+                    TType(EbtFloat, resources.FragmentPrecisionHigh ? EbpHigh : EbpMedium, EvqFragDepth, 1)));
             }
 
-            symbolTable.insert(ESSL3_BUILTINS,
-                               new TVariable(NewPoolTString("gl_FragDepth"),
-                                             TType(EbtFloat, EbpHigh, EvqFragDepth, 1)));
-
             if (resources.EXT_shader_framebuffer_fetch || resources.NV_shader_framebuffer_fetch)
             {
                 TType lastFragData(EbtFloat, EbpMedium, EvqLastFragData, 4, 1, true);
diff --git a/src/compiler/translator/OutputHLSL.cpp b/src/compiler/translator/OutputHLSL.cpp
index cfdd280..e094db2 100644
--- a/src/compiler/translator/OutputHLSL.cpp
+++ b/src/compiler/translator/OutputHLSL.cpp
@@ -1386,7 +1386,7 @@
             mUsesInstanceID = true;
             out << name;
         }
-        else if (name == "gl_FragDepthEXT" || name == "gl_FragDepth")
+        else if (name == "gl_FragDepthEXT")
         {
             mUsesFragDepth = true;
             out << "gl_Depth";
diff --git a/src/compiler/translator/VariableInfo.cpp b/src/compiler/translator/VariableInfo.cpp
index dd627e8..c1c4c2d 100644
--- a/src/compiler/translator/VariableInfo.cpp
+++ b/src/compiler/translator/VariableInfo.cpp
@@ -150,7 +150,6 @@
       mLastFragDataAdded(false),
       mFragColorAdded(false),
       mFragDataAdded(false),
-      mFragDepthEXTAdded(false),
       mFragDepthAdded(false),
       mHashFunction(hashFunction),
       mSymbolTable(symbolTable)
@@ -403,8 +402,8 @@
                   mFragDataAdded = true;
               }
               return;
-          case EvqFragDepthEXT:
-              if (!mFragDepthEXTAdded)
+          case EvqFragDepth:
+              if (!mFragDepthAdded)
               {
                   Attribute info;
                   const char kName[] = "gl_FragDepthEXT";
@@ -418,25 +417,9 @@
                                               ->getType());
                   info.staticUse = true;
                   mOutputVariables->push_back(info);
-                  mFragDepthEXTAdded = true;
-              }
-              return;
-          case EvqFragDepth:
-              if (!mFragDepthAdded)
-              {
-                  Attribute info;
-                  const char kName[] = "gl_FragDepth";
-                  info.name          = kName;
-                  info.mappedName    = kName;
-                  info.type          = GL_FLOAT;
-                  info.arraySize     = 0;
-                  info.precision     = GL_HIGH_FLOAT;
-                  info.staticUse = true;
-                  mOutputVariables->push_back(info);
                   mFragDepthAdded = true;
               }
               return;
-
           default:
             break;
         }
diff --git a/src/compiler/translator/VariableInfo.h b/src/compiler/translator/VariableInfo.h
index 76f7b15..028c699 100644
--- a/src/compiler/translator/VariableInfo.h
+++ b/src/compiler/translator/VariableInfo.h
@@ -58,7 +58,6 @@
     bool mLastFragDataAdded;
     bool mFragColorAdded;
     bool mFragDataAdded;
-    bool mFragDepthEXTAdded;
     bool mFragDepthAdded;
 
     ShHashFunction64 mHashFunction;