[ANGLE - iOS] webgl/1.0.3/conformance/extensions/ext-sRGB.html is failing
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 May 2020 02:26:29 +0000 (02:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 May 2020 02:26:29 +0000 (02:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=212277

Patch by Kenneth Russell <kbr@chromium.org> on 2020-05-22
Reviewed by Dean Jackson.

Source/ThirdParty/ANGLE:

Properly translate GL_EXT_sRGB enums to ES 3.0 enums when
GL_EXT_sRGB is not supported.

* src/libANGLE/renderer/gl/formatutilsgl.cpp:
(rx::nativegl::GetNativeInternalFormat):
(rx::nativegl::GetNativeFormat):

LayoutTests:

Remove failure expectation for the layout test on iOS.

* platform/ios/TestExpectations:

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

LayoutTests/ChangeLog
LayoutTests/platform/ios/TestExpectations
Source/ThirdParty/ANGLE/ChangeLog
Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/formatutilsgl.cpp

index de5af13..0ab3b50 100644 (file)
@@ -1,5 +1,16 @@
 2020-05-22  Kenneth Russell  <kbr@chromium.org>
 
+        [ANGLE - iOS] webgl/1.0.3/conformance/extensions/ext-sRGB.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=212277
+
+        Reviewed by Dean Jackson.
+
+        Remove failure expectation for the layout test on iOS.
+
+        * platform/ios/TestExpectations:
+
+2020-05-22  Kenneth Russell  <kbr@chromium.org>
+
         Remove failure expectation for webgl/1.0.3/conformance/extensions/webgl-depth-texture.html on iOS
         https://bugs.webkit.org/show_bug.cgi?id=212284
 
index 9caedb0..b2d30dd 100644 (file)
@@ -3475,7 +3475,6 @@ webkit.org/b/207858 fast/canvas/webgl/oes-texture-float-linear.html [ Pass Failu
 webkit.org/b/207858 fast/canvas/webgl/oes-vertex-array-object.html [ Pass Failure ]
 webkit.org/b/207858 fast/canvas/webgl/tex-image-and-sub-image-2d-with-video.html [ Pass Failure ]
 webkit.org/b/207858 webgl/1.0.3/conformance/context/context-lost-restored.html [ Pass Failure ]
-webkit.org/b/207858 webgl/1.0.3/conformance/extensions/ext-sRGB.html [ Pass Failure ]
 webkit.org/b/207858 webgl/1.0.3/conformance/glsl/misc/shader-struct-scope.html [ Pass Failure ]
 webkit.org/b/207858 webgl/1.0.3/conformance/misc/uninitialized-test.html [ Pass Failure ]
 webkit.org/b/207858 webgl/1.0.3/conformance/programs/program-test.html [ Failure ]
index f7d9803..bc8b798 100644 (file)
@@ -1,5 +1,19 @@
 2020-05-22  Kenneth Russell  <kbr@chromium.org>
 
+        [ANGLE - iOS] webgl/1.0.3/conformance/extensions/ext-sRGB.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=212277
+
+        Reviewed by Dean Jackson.
+
+        Properly translate GL_EXT_sRGB enums to ES 3.0 enums when
+        GL_EXT_sRGB is not supported.
+
+        * src/libANGLE/renderer/gl/formatutilsgl.cpp:
+        (rx::nativegl::GetNativeInternalFormat):
+        (rx::nativegl::GetNativeFormat):
+
+2020-05-22  Kenneth Russell  <kbr@chromium.org>
+
         [ANGLE - iOS] fast/canvas/webgl/webgl-depth-texture.html is failing
         https://bugs.webkit.org/show_bug.cgi?id=212271
 
index 50b1073..2181eca 100644 (file)
@@ -540,12 +540,24 @@ static GLenum GetNativeInternalFormat(const FunctionsGL *functions,
             // Workaround Adreno driver not supporting unsized EXT_texture_rg formats
             result = internalFormat.sizedInternalFormat;
         }
-        else if (features.unsizedsRGBReadPixelsDoesntTransform.enabled &&
-                 internalFormat.colorEncoding == GL_SRGB)
+        else if (internalFormat.colorEncoding == GL_SRGB)
         {
-            // Work around some Adreno driver bugs that don't read back SRGB data correctly when
-            // it's in unsized SRGB texture formats.
-            result = internalFormat.sizedInternalFormat;
+            if (features.unsizedsRGBReadPixelsDoesntTransform.enabled)
+            {
+                // Work around some Adreno driver bugs that don't read back SRGB data correctly when
+                // it's in unsized SRGB texture formats.
+                result = internalFormat.sizedInternalFormat;
+            }
+            else if (!functions->hasGLESExtension("GL_EXT_sRGB"))
+            {
+                // Unsized sRGB internal formats are unlikely to be supported by the
+                // driver. Transform them to sized internal formats.
+                if (internalFormat.internalFormat == GL_SRGB ||
+                    internalFormat.internalFormat == GL_SRGB_ALPHA_EXT)
+                {
+                    result = internalFormat.sizedInternalFormat;
+                }
+            }
         }
         else if ((internalFormat.internalFormat == GL_DEPTH_COMPONENT ||
                   internalFormat.internalFormat == GL_DEPTH_STENCIL) &&
@@ -632,14 +644,15 @@ static GLenum GetNativeFormat(const FunctionsGL *functions,
     }
     else if (functions->isAtLeastGLES(gl::Version(3, 0)))
     {
-        if (features.unsizedsRGBReadPixelsDoesntTransform.enabled)
+        if (features.unsizedsRGBReadPixelsDoesntTransform.enabled ||
+            !functions->hasGLESExtension("GL_EXT_sRGB"))
         {
             if (format == GL_SRGB)
             {
                 result = GL_RGB;
             }
 
-            if (format == GL_SRGB_ALPHA)
+            if (format == GL_SRGB_ALPHA_EXT)
             {
                 result = GL_RGBA;
             }