Remove FP16 support from ANGLE. Previous workaround was incomplete.
authorbrianosman <brianosman@google.com>
Mon, 29 Aug 2016 13:46:07 +0000 (06:46 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 29 Aug 2016 13:46:07 +0000 (06:46 -0700)
ANGLE is using the wrong external type (GL_HALF_FLOAT) when querying for
ReadPixels format, but it validates parameters to TexImage2D against the
correct type (GL_HALF_FLOAT_OES). Rather than introduce a lot of
complexity to work around the inconsistency, I'm just going to remove
support for now.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2288233002

Review-Url: https://codereview.chromium.org/2288233002

src/gpu/gl/GrGLCaps.cpp

index 7b66898..255d516 100644 (file)
@@ -1659,6 +1659,13 @@ void GrGLCaps::initConfigTable(const GrGLContextInfo& ctxInfo, const GrGLInterfa
         }
     }
 
+    if (kANGLE_GrGLDriver == ctxInfo.driver()) {
+        // ANGLE reports the wrong format for half-float (See http://anglebug.com/1478), but
+        // validates creation against the correct format. Rather than work around those bugs,
+        // just black-list support entirely for now.
+        hasHalfFPTextures = false;
+    }
+
     fConfigTable[kRGBA_float_GrPixelConfig].fFormats.fBaseInternalFormat = GR_GL_RGBA;
     fConfigTable[kRGBA_float_GrPixelConfig].fFormats.fSizedInternalFormat = GR_GL_RGBA32F;
     fConfigTable[kRGBA_float_GrPixelConfig].fFormats.fExternalFormat[kOther_ExternalFormatUsage] =
@@ -1699,9 +1706,7 @@ void GrGLCaps::initConfigTable(const GrGLContextInfo& ctxInfo, const GrGLInterfa
             = GR_GL_ALPHA;
         fConfigTable[kAlpha_half_GrPixelConfig].fSwizzle = GrSwizzle::AAAA();
     }
-    // ANGLE reports the wrong format for half-float (See http://anglebug.com/1478)
-    if (kGL_GrGLStandard == ctxInfo.standard() || ctxInfo.version() >= GR_GL_VER(3, 0) ||
-        kANGLE_GrGLDriver == ctxInfo.driver()) {
+    if (kGL_GrGLStandard == ctxInfo.standard() || ctxInfo.version() >= GR_GL_VER(3, 0)) {
         fConfigTable[kAlpha_half_GrPixelConfig].fFormats.fExternalType = GR_GL_HALF_FLOAT;
     } else {
         fConfigTable[kAlpha_half_GrPixelConfig].fFormats.fExternalType = GR_GL_HALF_FLOAT_OES;
@@ -1725,9 +1730,7 @@ void GrGLCaps::initConfigTable(const GrGLContextInfo& ctxInfo, const GrGLInterfa
     fConfigTable[kRGBA_half_GrPixelConfig].fFormats.fSizedInternalFormat = GR_GL_RGBA16F;
     fConfigTable[kRGBA_half_GrPixelConfig].fFormats.fExternalFormat[kOther_ExternalFormatUsage] =
         GR_GL_RGBA;
-    // ANGLE reports the wrong format for half-float (See http://anglebug.com/1478)
-    if (kGL_GrGLStandard == ctxInfo.standard() || ctxInfo.version() >= GR_GL_VER(3, 0) ||
-        kANGLE_GrGLDriver == ctxInfo.driver()) {
+    if (kGL_GrGLStandard == ctxInfo.standard() || ctxInfo.version() >= GR_GL_VER(3, 0)) {
         fConfigTable[kRGBA_half_GrPixelConfig].fFormats.fExternalType = GR_GL_HALF_FLOAT;
     } else {
         fConfigTable[kRGBA_half_GrPixelConfig].fFormats.fExternalType = GR_GL_HALF_FLOAT_OES;