Log Message
OES_texture_float / OES_texture_half_float unavailable in WebGL 1.0 on iOS Simulator with ANGLE https://bugs.webkit.org/show_bug.cgi?id=210524
Patch by Kenneth Russell <k...@chromium.org> on 2020-05-20 Reviewed by Dean Jackson. Source/ThirdParty/ANGLE: Emulate LUMINANCE, ALPHA and LUMINANCE_ALPHA floating-point textures on top of RED / RG textures when the underlying OES_texture_float/half_float OpenGL ES extensions are unavailable. This makes the conformance/extensions/oes-texture{-half}-float* tests run and pass in the iOS Simulator. This change is being reviewed upstream in the ANGLE repository and is only being uploaded here for testing purposes. It will be rolled in with the next ANGLE update. * src/libANGLE/renderer/gl/TextureGL.cpp: (rx::TextureGL::setSwizzle): * src/libANGLE/renderer/gl/formatutilsgl.cpp: (rx::nativegl::BuildInternalFormatInfoMap): (rx::nativegl::IsLUMAFormat): (rx::nativegl::EmulateLUMAFormat): (rx::nativegl::EmulateLUMA): (rx::nativegl::GetNativeInternalFormat): (rx::nativegl::GetNativeFormat): (rx::nativegl::GetNativeType): (rx::nativegl::GetTexImageFormat): (rx::nativegl::GetTexSubImageFormat): LayoutTests: Remove expected failure for webgl/2.0.0/conformance/extensions/oes-texture-float-expected.txt on ios-simulator. Enable fast/canvas/webgl/oes-texture-half-float-uint16.html on iOS. * platform/ios-simulator/webgl/2.0.0/conformance/extensions/oes-texture-float-expected.txt: Removed. * platform/ios/TestExpectations:
Modified Paths
- trunk/LayoutTests/ChangeLog
- trunk/LayoutTests/platform/ios/TestExpectations
- trunk/Source/ThirdParty/ANGLE/ChangeLog
- trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/TextureGL.cpp
- trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/formatutilsgl.cpp
Removed Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (261974 => 261975)
--- trunk/LayoutTests/ChangeLog 2020-05-21 00:12:45 UTC (rev 261974)
+++ trunk/LayoutTests/ChangeLog 2020-05-21 00:16:47 UTC (rev 261975)
@@ -1,3 +1,18 @@
+2020-05-20 Kenneth Russell <k...@chromium.org>
+
+ OES_texture_float / OES_texture_half_float unavailable in WebGL 1.0 on iOS Simulator with ANGLE
+ https://bugs.webkit.org/show_bug.cgi?id=210524
+
+ Reviewed by Dean Jackson.
+
+ Remove expected failure for
+ webgl/2.0.0/conformance/extensions/oes-texture-float-expected.txt
+ on ios-simulator. Enable
+ fast/canvas/webgl/oes-texture-half-float-uint16.html on iOS.
+
+ * platform/ios-simulator/webgl/2.0.0/conformance/extensions/oes-texture-float-expected.txt: Removed.
+ * platform/ios/TestExpectations:
+
2020-05-20 Chris Dumez <cdu...@apple.com>
(r261946) [ iOS ] fast/frames/didBecomeCurrentDocumentInFrame-crash.html is failing
Modified: trunk/LayoutTests/platform/ios/TestExpectations (261974 => 261975)
--- trunk/LayoutTests/platform/ios/TestExpectations 2020-05-21 00:12:45 UTC (rev 261974)
+++ trunk/LayoutTests/platform/ios/TestExpectations 2020-05-21 00:16:47 UTC (rev 261975)
@@ -3469,7 +3469,6 @@
webkit.org/b/207858 webgl/webgl-backing-store-size-update.html [ Pass Failure ImageOnlyFailure ]
webkit.org/b/207858 webgl/webgl-border.html [ Pass Failure ImageOnlyFailure ]
webkit.org/b/207858 webgl/webgl-box-shadow.html [ Pass Failure ImageOnlyFailure ]
-webkit.org/b/207858 fast/canvas/webgl/oes-texture-half-float-uint16.html [ Pass Failure ]
webkit.org/b/207858 fast/canvas/webgl/program-test.html [ Failure ]
webkit.org/b/207858 fast/canvas/webgl/uninitialized-test.html [ Pass Failure ]
webkit.org/b/207858 fast/canvas/webgl/oes-texture-float-linear.html [ Pass Failure ]
Deleted: trunk/LayoutTests/platform/ios-simulator/webgl/2.0.0/conformance/extensions/oes-texture-float-expected.txt (261974 => 261975)
--- trunk/LayoutTests/platform/ios-simulator/webgl/2.0.0/conformance/extensions/oes-texture-float-expected.txt 2020-05-21 00:12:45 UTC (rev 261974)
+++ trunk/LayoutTests/platform/ios-simulator/webgl/2.0.0/conformance/extensions/oes-texture-float-expected.txt 2020-05-21 00:16:47 UTC (rev 261975)
@@ -1,31 +0,0 @@
-This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
-
-Test: ../../resources/webgl_test_files/conformance/extensions/oes-texture-float.html
-[ 1: PASS ] WebGL context exists
-[ 2: PASS ] getError was expected value: NO_ERROR : texture parameter setup should succeed
-[ 3: PASS ] getError was expected value: INVALID_ENUM : floating-point texture allocation must be disallowed if OES_texture_float isn't enabled
-[ 4: PASS ] Successfully enabled OES_texture_float extension
-[ 5: PASS ] getError was expected value: NO_ERROR : texture parameter setup should succeed
-[ 6: PASS ] getError was expected value: NO_ERROR : floating-point texture allocation should succeed if OES_texture_float is enabled
-[ 7: PASS ] should be green
-[ 8: FAIL ] should be red at (0, 0) expected: 255,0,0,255 was 0,255,0,255
-[ 9: PASS ] getError was expected value: NO_ERROR : texture parameter setup should succeed
-[ 10: PASS ] getError was expected value: NO_ERROR : floating-point texture allocation should succeed if OES_texture_float is enabled
-[ 11: PASS ] should be green
-[ 12: FAIL ] should be red at (0, 0) expected: 255,0,0,255 was 0,255,0,255
-[ 13: PASS ] getError was expected value: NO_ERROR : texture parameter setup should succeed
-[ 14: PASS ] getError was expected value: NO_ERROR : floating-point texture allocation should succeed if OES_texture_float is enabled
-[ 15: PASS ] should be green
-[ 16: FAIL ] should be red at (0, 0) expected: 255,0,0,255 was 0,255,0,255
-[ 17: PASS ] getError was expected value: NO_ERROR : texture parameter setup should succeed
-[ 18: PASS ] getError was expected value: NO_ERROR : floating-point texture allocation should succeed if OES_texture_float is enabled
-[ 19: PASS ] should be green
-[ 20: FAIL ] should be red at (0, 0) expected: 255,0,0,255 was 0,255,0,255
-[ 21: PASS ] getError was expected value: NO_ERROR : texture parameter setup should succeed
-[ 22: PASS ] getError was expected value: NO_ERROR : floating-point texture allocation should succeed if OES_texture_float is enabled
-[ 23: PASS ] should be green
-[ 24: FAIL ] should be red at (0, 0) expected: 255,0,0,255 was 0,255,0,255
-[ 25: PASS ] gl.getExtension("OES_texture_float").myProperty is 2
-[ 26: PASS ] successfullyParsed is true
-[ FAIL ] 5 failures reported
-
Modified: trunk/Source/ThirdParty/ANGLE/ChangeLog (261974 => 261975)
--- trunk/Source/ThirdParty/ANGLE/ChangeLog 2020-05-21 00:12:45 UTC (rev 261974)
+++ trunk/Source/ThirdParty/ANGLE/ChangeLog 2020-05-21 00:16:47 UTC (rev 261975)
@@ -1,3 +1,34 @@
+2020-05-20 Kenneth Russell <k...@chromium.org>
+
+ OES_texture_float / OES_texture_half_float unavailable in WebGL 1.0 on iOS Simulator with ANGLE
+ https://bugs.webkit.org/show_bug.cgi?id=210524
+
+ Reviewed by Dean Jackson.
+
+ Emulate LUMINANCE, ALPHA and LUMINANCE_ALPHA floating-point
+ textures on top of RED / RG textures when the underlying
+ OES_texture_float/half_float OpenGL ES extensions are unavailable.
+
+ This makes the conformance/extensions/oes-texture{-half}-float*
+ tests run and pass in the iOS Simulator.
+
+ This change is being reviewed upstream in the ANGLE repository and
+ is only being uploaded here for testing purposes. It will be
+ rolled in with the next ANGLE update.
+
+ * src/libANGLE/renderer/gl/TextureGL.cpp:
+ (rx::TextureGL::setSwizzle):
+ * src/libANGLE/renderer/gl/formatutilsgl.cpp:
+ (rx::nativegl::BuildInternalFormatInfoMap):
+ (rx::nativegl::IsLUMAFormat):
+ (rx::nativegl::EmulateLUMAFormat):
+ (rx::nativegl::EmulateLUMA):
+ (rx::nativegl::GetNativeInternalFormat):
+ (rx::nativegl::GetNativeFormat):
+ (rx::nativegl::GetNativeType):
+ (rx::nativegl::GetTexImageFormat):
+ (rx::nativegl::GetTexSubImageFormat):
+
2020-05-18 James Darpinian <jdarpin...@chromium.org>
Enable regenerateStructNames workaround on iOS
Modified: trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/TextureGL.cpp (261974 => 261975)
--- trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/TextureGL.cpp 2020-05-21 00:12:45 UTC (rev 261974)
+++ trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/TextureGL.cpp 2020-05-21 00:16:47 UTC (rev 261975)
@@ -1610,8 +1610,22 @@
onStateChange(angle::SubjectMessage::SubjectChanged);
stateManager->bindTexture(getType(), mTextureID);
- ANGLE_GL_TRY(context, functions->texParameteriv(ToGLenum(getType()),
- GL_TEXTURE_SWIZZLE_RGBA, swizzle));
+ if (functions->standard == STANDARD_GL_ES)
+ {
+ ANGLE_GL_TRY(context, functions->texParameteri(ToGLenum(getType()),
+ GL_TEXTURE_SWIZZLE_R, swizzle[0]));
+ ANGLE_GL_TRY(context, functions->texParameteri(ToGLenum(getType()),
+ GL_TEXTURE_SWIZZLE_G, swizzle[1]));
+ ANGLE_GL_TRY(context, functions->texParameteri(ToGLenum(getType()),
+ GL_TEXTURE_SWIZZLE_B, swizzle[2]));
+ ANGLE_GL_TRY(context, functions->texParameteri(ToGLenum(getType()),
+ GL_TEXTURE_SWIZZLE_A, swizzle[3]));
+ }
+ else
+ {
+ ANGLE_GL_TRY(context, functions->texParameteriv(ToGLenum(getType()),
+ GL_TEXTURE_SWIZZLE_RGBA, swizzle));
+ }
}
return angle::Result::Continue;
}
Modified: trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/formatutilsgl.cpp (261974 => 261975)
--- trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/formatutilsgl.cpp 2020-05-21 00:12:45 UTC (rev 261974)
+++ trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/formatutilsgl.cpp 2020-05-21 00:16:47 UTC (rev 261975)
@@ -275,16 +275,16 @@
InsertFormatMapping(&map, GL_DEPTH_STENCIL, VersionOnly(1, 5), VersionOrExts(1, 5, "GL_ARB_depth_texture"), VersionOnly(1, 5), VersionOnly(2, 0), VersionOrExts(3, 0, "GL_OES_depth_texture"), VersionOnly(2, 0), VersionOnly(2, 0) );
// Luminance alpha formats
- // | Format | OpenGL texture support | Filter | Render | OpenGL ES texture support | Filter | OpenGL ES texture attachment support | OpenGL ES renderbuffer support |
- InsertFormatMapping(&map, GL_ALPHA8_EXT, AlwaysSupported(), AlwaysSupported(), NeverSupported(), AlwaysSupported(), AlwaysSupported(), NeverSupported(), NeverSupported() );
- InsertFormatMapping(&map, GL_LUMINANCE8_EXT, AlwaysSupported(), AlwaysSupported(), NeverSupported(), AlwaysSupported(), AlwaysSupported(), NeverSupported(), NeverSupported() );
- InsertFormatMapping(&map, GL_LUMINANCE8_ALPHA8_EXT, AlwaysSupported(), AlwaysSupported(), NeverSupported(), AlwaysSupported(), AlwaysSupported(), NeverSupported(), NeverSupported() );
- InsertFormatMapping(&map, GL_ALPHA16F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_half_float"), ExtsOnly("GL_OES_texture_half_float_linear"), NeverSupported(), NeverSupported() );
- InsertFormatMapping(&map, GL_LUMINANCE16F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_half_float"), ExtsOnly("GL_OES_texture_half_float_linear"), NeverSupported(), NeverSupported() );
- InsertFormatMapping(&map, GL_LUMINANCE_ALPHA16F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_half_float"), ExtsOnly("GL_OES_texture_half_float_linear"), NeverSupported(), NeverSupported() );
- InsertFormatMapping(&map, GL_ALPHA32F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_float"), ExtsOnly("GL_OES_texture_float_linear"), NeverSupported(), NeverSupported() );
- InsertFormatMapping(&map, GL_LUMINANCE32F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_float"), ExtsOnly("GL_OES_texture_float_linear"), NeverSupported(), NeverSupported() );
- InsertFormatMapping(&map, GL_LUMINANCE_ALPHA32F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_OES_texture_float"), ExtsOnly("GL_OES_texture_float_linear"), NeverSupported(), NeverSupported() );
+ // | Format | OpenGL texture support | Filter | Render | OpenGL ES texture support | Filter | OpenGL ES texture attachment support | OpenGL ES renderbuffer support |
+ InsertFormatMapping(&map, GL_ALPHA8_EXT, AlwaysSupported(), AlwaysSupported(), NeverSupported(), AlwaysSupported(), AlwaysSupported(), NeverSupported(), NeverSupported() );
+ InsertFormatMapping(&map, GL_LUMINANCE8_EXT, AlwaysSupported(), AlwaysSupported(), NeverSupported(), AlwaysSupported(), AlwaysSupported(), NeverSupported(), NeverSupported() );
+ InsertFormatMapping(&map, GL_LUMINANCE8_ALPHA8_EXT, AlwaysSupported(), AlwaysSupported(), NeverSupported(), AlwaysSupported(), AlwaysSupported(), NeverSupported(), NeverSupported() );
+ InsertFormatMapping(&map, GL_ALPHA16F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), VersionOrExts(3, 0, "GL_OES_texture_half_float"), ExtsOnly("GL_OES_texture_half_float_linear"), NeverSupported(), NeverSupported() );
+ InsertFormatMapping(&map, GL_LUMINANCE16F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), VersionOrExts(3, 0, "GL_OES_texture_half_float"), ExtsOnly("GL_OES_texture_half_float_linear"), NeverSupported(), NeverSupported() );
+ InsertFormatMapping(&map, GL_LUMINANCE_ALPHA16F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), VersionOrExts(3, 0, "GL_OES_texture_half_float"), ExtsOnly("GL_OES_texture_half_float_linear"), NeverSupported(), NeverSupported() );
+ InsertFormatMapping(&map, GL_ALPHA32F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), VersionOrExts(3, 0, "GL_OES_texture_float"), ExtsOnly("GL_OES_texture_float_linear"), NeverSupported(), NeverSupported() );
+ InsertFormatMapping(&map, GL_LUMINANCE32F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), VersionOrExts(3, 0, "GL_OES_texture_float"), ExtsOnly("GL_OES_texture_float_linear"), NeverSupported(), NeverSupported() );
+ InsertFormatMapping(&map, GL_LUMINANCE_ALPHA32F_EXT, VersionOrExts(3, 0, "GL_ARB_texture_float"), AlwaysSupported(), NeverSupported(), VersionOrExts(3, 0, "GL_OES_texture_float"), ExtsOnly("GL_OES_texture_float_linear"), NeverSupported(), NeverSupported() );
// EXT_texture_compression_rgtc formats
// | Format | OpenGL texture support | Filter | Render | OpenGL ES texture support | Filter | OpenGL ES texture attachment support | OpenGL ES renderbuffer support |
@@ -434,6 +434,33 @@
return *defaultInternalFormat;
}
+static bool IsLUMAFormat(GLenum format)
+{
+ return (format == GL_LUMINANCE || format == GL_ALPHA || format == GL_LUMINANCE_ALPHA);
+}
+
+static GLenum EmulateLUMAFormat(const GLenum format)
+{
+ // This is needed separately from EmulateLUMA because some format/type combinations that come in
+ // to GetNativeFormat don't have entries in the internal format map.
+
+ ASSERT(IsLUMAFormat(format));
+
+ if (format == GL_LUMINANCE || format == GL_ALPHA)
+ return GL_RED;
+
+ return GL_RG;
+}
+
+static const gl::InternalFormat &EmulateLUMA(const gl::InternalFormat &internalFormat)
+{
+ ASSERT(IsLUMAFormat(internalFormat.format));
+
+ // Work around deprecated luminance/alpha formats in the OpenGL core profile, and OpenGL ES 3.0
+ // and greater, by backing them with R or RG textures.
+ return gl::GetInternalFormatInfo(EmulateLUMAFormat(internalFormat.format), internalFormat.type);
+}
+
static GLenum GetNativeInternalFormat(const FunctionsGL *functions,
const angle::FeaturesGL &features,
const gl::InternalFormat &internalFormat)
@@ -479,26 +506,34 @@
if ((functions->profile & GL_CONTEXT_CORE_PROFILE_BIT) != 0)
{
- // Work around deprecated luminance alpha formats in the OpenGL core profile by backing
- // them with R or RG textures.
- if (internalFormat.format == GL_LUMINANCE || internalFormat.format == GL_ALPHA)
+ if (IsLUMAFormat(internalFormat.format))
{
- result = gl::GetInternalFormatInfo(GL_RED, internalFormat.type).sizedInternalFormat;
+ result = EmulateLUMA(internalFormat).sizedInternalFormat;
}
-
- if (internalFormat.format == GL_LUMINANCE_ALPHA)
- {
- result = gl::GetInternalFormatInfo(GL_RG, internalFormat.type).sizedInternalFormat;
- }
}
}
else if (functions->isAtLeastGLES(gl::Version(3, 0)))
{
- if (internalFormat.componentType == GL_FLOAT && !internalFormat.isLUMA())
+ if (internalFormat.componentType == GL_FLOAT)
{
- // Use sized internal formats for floating point textures. Extensions such as
- // EXT_color_buffer_float require the sized formats to be renderable.
- result = internalFormat.sizedInternalFormat;
+ if (!internalFormat.isLUMA())
+ {
+ // Use sized internal formats for floating point textures. Extensions such as
+ // EXT_color_buffer_float require the sized formats to be renderable.
+ result = internalFormat.sizedInternalFormat;
+ }
+ else if ((internalFormat.type == GL_FLOAT &&
+ !functions->hasGLESExtension("GL_OES_texture_float")) ||
+ (internalFormat.type == GL_HALF_FLOAT_OES &&
+ !functions->hasGLESExtension("GL_OES_texture_half_float")))
+ {
+ // The legacy luminance/alpha formats from OES_texture_float are emulated with R/RG
+ // textures.
+ if (IsLUMAFormat(internalFormat.format))
+ {
+ result = EmulateLUMA(internalFormat).sizedInternalFormat;
+ }
+ }
}
else if (internalFormat.format == GL_RED_EXT || internalFormat.format == GL_RG_EXT)
{
@@ -519,7 +554,8 @@
static GLenum GetNativeFormat(const FunctionsGL *functions,
const angle::FeaturesGL &features,
- GLenum format)
+ GLenum format,
+ GLenum type)
{
GLenum result = format;
@@ -541,15 +577,10 @@
{
// Work around deprecated luminance alpha formats in the OpenGL core profile by backing
// them with R or RG textures.
- if (format == GL_LUMINANCE || format == GL_ALPHA)
+ if (IsLUMAFormat(format))
{
- result = GL_RED;
+ result = EmulateLUMAFormat(format);
}
-
- if (format == GL_LUMINANCE_ALPHA)
- {
- result = GL_RG;
- }
}
}
else if (functions->isAtLeastGLES(gl::Version(3, 0)))
@@ -566,6 +597,18 @@
result = GL_RGBA;
}
}
+
+ if ((type == GL_FLOAT && !functions->hasGLESExtension("GL_OES_texture_float")) ||
+ (type == GL_HALF_FLOAT_OES &&
+ !functions->hasGLESExtension("GL_OES_texture_half_float")))
+ {
+ // On ES 3.0 systems that don't have GL_OES_texture_float or OES_texture_half_float, the
+ // LUMINANCE/ALPHA formats from those extensions must be emulated with R/RG textures.
+ if (IsLUMAFormat(format))
+ {
+ result = EmulateLUMAFormat(format);
+ }
+ }
}
return result;
@@ -629,18 +672,12 @@
{
if (type == GL_HALF_FLOAT_OES)
{
- switch (format)
+ if (!IsLUMAFormat(format) || !functions->hasGLESExtension("GL_OES_texture_half_float"))
{
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE:
- case GL_ALPHA:
- // In ES3, these formats come from EXT_texture_storage, which uses
- // HALF_FLOAT_OES. Other formats (like RGBA) use HALF_FLOAT (non-OES) in ES3.
- break;
-
- default:
- result = GL_HALF_FLOAT;
- break;
+ // In ES3, the luminance formats come from OES_texture_half_float, which uses
+ // HALF_FLOAT_OES. Other formats (like RGBA) use HALF_FLOAT (non-OES) in ES3.
+ // If they're emulated (see above), use HALF_FLOAT.
+ result = GL_HALF_FLOAT;
}
}
}
@@ -701,7 +738,7 @@
TexImageFormat result;
result.internalFormat = GetNativeInternalFormat(
functions, features, gl::GetInternalFormatInfo(internalFormat, type));
- result.format = GetNativeFormat(functions, features, format);
+ result.format = GetNativeFormat(functions, features, format, type);
result.type = GetNativeType(functions, features, format, type);
return result;
}
@@ -712,7 +749,7 @@
GLenum type)
{
TexSubImageFormat result;
- result.format = GetNativeFormat(functions, features, format);
+ result.format = GetNativeFormat(functions, features, format, type);
result.type = GetNativeType(functions, features, format, type);
return result;
}
_______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes