Diff
Modified: branches/safari-612-branch/LayoutTests/ChangeLog (284941 => 284942)
--- branches/safari-612-branch/LayoutTests/ChangeLog 2021-10-27 21:05:20 UTC (rev 284941)
+++ branches/safari-612-branch/LayoutTests/ChangeLog 2021-10-27 21:05:24 UTC (rev 284942)
@@ -1,5 +1,70 @@
2021-10-26 Alan Coon <[email protected]>
+ Cherry-pick r282160. rdar://problem/84630406
+
+ webgl/2.0.y/conformance/extensions/webgl-compressed-texture-etc.html fails on Metal
+ https://bugs.webkit.org/show_bug.cgi?id=229940
+
+ Patch by Kimmo Kinnunen <[email protected]> on 2021-09-08
+ Reviewed by Dean Jackson.
+
+ Source/WebCore:
+
+ Add compressed texture upload internal format validation back.
+ This was disabled when ANGLE was integrated.
+ ANGLE does not check whether the extensions are enabled or not.
+
+ Fixes tests:
+ webgl/1.0.x/conformance/extensions/webgl-compressed-texture-etc.html
+ webgl/2.0.y/conformance/extensions/webgl-compressed-texture-etc.html
+
+ * html/canvas/WebGL2RenderingContext.cpp:
+ (WebCore::WebGL2RenderingContext::compressedTexImage2D):
+ * html/canvas/WebGLRenderingContextBase.cpp:
+ (WebCore::WebGLRenderingContextBase::compressedTexImage2D):
+ (WebCore::WebGLRenderingContextBase::compressedTexSubImage2D):
+ (WebCore::WebGLRenderingContextBase::validateCompressedTexFormat):
+ * html/canvas/WebGLRenderingContextBase.h:
+
+ LayoutTests:
+
+ Enable webgl/2.0.y/conformance/extensions/webgl-compressed-texture-etc.html
+ explicitly until 2.0.y is activated. Same for 1.0.x.
+
+ * webgl/TestExpectations:
+ * webgl/webgl-allow-shared-expected.txt:
+ The test tests that SharedArrayBuffer does not produce an error for
+ when used as TexImageSource. The change makes two compressedTexImage
+ calls produce new GL errors due to the extension not being enabled.
+ The errors are added to the expected.txt. This does not invalidate
+ the objective of the change -- the SharedArrayBuffer type validation
+ happens before the GL validation and as such will be visible if
+ the objective of the test is broken.
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@282160 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2021-09-08 Kimmo Kinnunen <[email protected]>
+
+ webgl/2.0.y/conformance/extensions/webgl-compressed-texture-etc.html fails on Metal
+ https://bugs.webkit.org/show_bug.cgi?id=229940
+
+ Reviewed by Dean Jackson.
+
+ Enable webgl/2.0.y/conformance/extensions/webgl-compressed-texture-etc.html
+ explicitly until 2.0.y is activated. Same for 1.0.x.
+
+ * webgl/TestExpectations:
+ * webgl/webgl-allow-shared-expected.txt:
+ The test tests that SharedArrayBuffer does not produce an error for
+ when used as TexImageSource. The change makes two compressedTexImage
+ calls produce new GL errors due to the extension not being enabled.
+ The errors are added to the expected.txt. This does not invalidate
+ the objective of the change -- the SharedArrayBuffer type validation
+ happens before the GL validation and as such will be visible if
+ the objective of the test is broken.
+
+2021-10-26 Alan Coon <[email protected]>
+
Cherry-pick r282132. rdar://problem/84629639
webgl/2.0.y/deqp/functional/gles3/rbostatequery.html fails on Metal
Modified: branches/safari-612-branch/LayoutTests/webgl/TestExpectations (284941 => 284942)
--- branches/safari-612-branch/LayoutTests/webgl/TestExpectations 2021-10-27 21:05:20 UTC (rev 284941)
+++ branches/safari-612-branch/LayoutTests/webgl/TestExpectations 2021-10-27 21:05:24 UTC (rev 284942)
@@ -22,4 +22,6 @@
webgl/2.0.0/conformance2/textures/misc/tex-srgb-mipmap.html [ Skip ]
# Explicitly enable tests which we have fixed. These expectations will be removed when 1.0.x/2.0.y is enabled.
+webgl/1.0.x/conformance/extensions/webgl-compressed-texture-etc.html [ Pass ]
+webgl/2.0.y/conformance/extensions/webgl-compressed-texture-etc.html [ Pass ]
webgl/2.0.y/deqp/functional/gles3/rbostatequery.html [ Pass ]
Modified: branches/safari-612-branch/LayoutTests/webgl/webgl-allow-shared-expected.txt (284941 => 284942)
--- branches/safari-612-branch/LayoutTests/webgl/webgl-allow-shared-expected.txt 2021-10-27 21:05:20 UTC (rev 284941)
+++ branches/safari-612-branch/LayoutTests/webgl/webgl-allow-shared-expected.txt 2021-10-27 21:05:24 UTC (rev 284942)
@@ -1,6 +1,8 @@
CONSOLE MESSAGE: WebGL: INVALID_VALUE: bufferSubData: offset out of range
CONSOLE MESSAGE: WebGL: INVALID_ENUM: texImage2D: invalid texture type
CONSOLE MESSAGE: WebGL: INVALID_ENUM: texSubImage2D: invalid texture type
+CONSOLE MESSAGE: WebGL: INVALID_ENUM: compressedTexImage2D: invalid format
+CONSOLE MESSAGE: WebGL: INVALID_ENUM: compressedTexSubImage2D: invalid format
CONSOLE MESSAGE: WebGL: INVALID_VALUE: bufferSubData: offset out of range
CONSOLE MESSAGE: WebGL: INVALID_OPERATION: texImage3D: no texture bound to target
CONSOLE MESSAGE: WebGL: INVALID_OPERATION: texImage3D: no texture bound to target
Modified: branches/safari-612-branch/Source/WebCore/ChangeLog (284941 => 284942)
--- branches/safari-612-branch/Source/WebCore/ChangeLog 2021-10-27 21:05:20 UTC (rev 284941)
+++ branches/safari-612-branch/Source/WebCore/ChangeLog 2021-10-27 21:05:24 UTC (rev 284942)
@@ -1,5 +1,73 @@
2021-10-26 Alan Coon <[email protected]>
+ Cherry-pick r282160. rdar://problem/84630406
+
+ webgl/2.0.y/conformance/extensions/webgl-compressed-texture-etc.html fails on Metal
+ https://bugs.webkit.org/show_bug.cgi?id=229940
+
+ Patch by Kimmo Kinnunen <[email protected]> on 2021-09-08
+ Reviewed by Dean Jackson.
+
+ Source/WebCore:
+
+ Add compressed texture upload internal format validation back.
+ This was disabled when ANGLE was integrated.
+ ANGLE does not check whether the extensions are enabled or not.
+
+ Fixes tests:
+ webgl/1.0.x/conformance/extensions/webgl-compressed-texture-etc.html
+ webgl/2.0.y/conformance/extensions/webgl-compressed-texture-etc.html
+
+ * html/canvas/WebGL2RenderingContext.cpp:
+ (WebCore::WebGL2RenderingContext::compressedTexImage2D):
+ * html/canvas/WebGLRenderingContextBase.cpp:
+ (WebCore::WebGLRenderingContextBase::compressedTexImage2D):
+ (WebCore::WebGLRenderingContextBase::compressedTexSubImage2D):
+ (WebCore::WebGLRenderingContextBase::validateCompressedTexFormat):
+ * html/canvas/WebGLRenderingContextBase.h:
+
+ LayoutTests:
+
+ Enable webgl/2.0.y/conformance/extensions/webgl-compressed-texture-etc.html
+ explicitly until 2.0.y is activated. Same for 1.0.x.
+
+ * webgl/TestExpectations:
+ * webgl/webgl-allow-shared-expected.txt:
+ The test tests that SharedArrayBuffer does not produce an error for
+ when used as TexImageSource. The change makes two compressedTexImage
+ calls produce new GL errors due to the extension not being enabled.
+ The errors are added to the expected.txt. This does not invalidate
+ the objective of the change -- the SharedArrayBuffer type validation
+ happens before the GL validation and as such will be visible if
+ the objective of the test is broken.
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@282160 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2021-09-08 Kimmo Kinnunen <[email protected]>
+
+ webgl/2.0.y/conformance/extensions/webgl-compressed-texture-etc.html fails on Metal
+ https://bugs.webkit.org/show_bug.cgi?id=229940
+
+ Reviewed by Dean Jackson.
+
+ Add compressed texture upload internal format validation back.
+ This was disabled when ANGLE was integrated.
+ ANGLE does not check whether the extensions are enabled or not.
+
+ Fixes tests:
+ webgl/1.0.x/conformance/extensions/webgl-compressed-texture-etc.html
+ webgl/2.0.y/conformance/extensions/webgl-compressed-texture-etc.html
+
+ * html/canvas/WebGL2RenderingContext.cpp:
+ (WebCore::WebGL2RenderingContext::compressedTexImage2D):
+ * html/canvas/WebGLRenderingContextBase.cpp:
+ (WebCore::WebGLRenderingContextBase::compressedTexImage2D):
+ (WebCore::WebGLRenderingContextBase::compressedTexSubImage2D):
+ (WebCore::WebGLRenderingContextBase::validateCompressedTexFormat):
+ * html/canvas/WebGLRenderingContextBase.h:
+
+2021-10-26 Alan Coon <[email protected]>
+
Cherry-pick r282132. rdar://problem/84629639
webgl/2.0.y/deqp/functional/gles3/rbostatequery.html fails on Metal
Modified: branches/safari-612-branch/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp (284941 => 284942)
--- branches/safari-612-branch/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp 2021-10-27 21:05:20 UTC (rev 284941)
+++ branches/safari-612-branch/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp 2021-10-27 21:05:24 UTC (rev 284942)
@@ -1362,6 +1362,8 @@
}
if (!validateTexture2DBinding("compressedTexImage2D", target))
return;
+ if (!validateCompressedTexFormat("compressedTexImage2D", internalformat))
+ return;
m_context->compressedTexImage2D(target, level, internalformat, width, height, border, imageSize, offset);
}
Modified: branches/safari-612-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (284941 => 284942)
--- branches/safari-612-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp 2021-10-27 21:05:20 UTC (rev 284941)
+++ branches/safari-612-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp 2021-10-27 21:05:24 UTC (rev 284942)
@@ -1797,16 +1797,15 @@
#if USE(ANGLE)
if (!validateTexture2DBinding("compressedTexImage2D", target))
return;
+ if (!validateCompressedTexFormat("compressedTexImage2D", internalformat))
+ return;
m_context->compressedTexImage2D(target, level, internalformat, width, height,
border, data.byteLength(), makeGCGLSpan(data.baseAddress(), data.byteLength()));
#else
if (!validateTexFuncLevel("compressedTexImage2D", target, level))
return;
-
- if (!validateCompressedTexFormat(internalformat)) {
- synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "compressedTexImage2D", "invalid internalformat");
+ if (!validateCompressedTexFormat("compressedTexImage2D", internalformat))
return;
- }
if (border) {
synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "compressedTexImage2D", "border not 0");
return;
@@ -1842,14 +1841,14 @@
#if USE(ANGLE)
if (!validateTexture2DBinding("compressedTexSubImage2D", target))
return;
+ if (!validateCompressedTexFormat("compressedTexSubImage2D", format))
+ return;
m_context->compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, data.byteLength(), GCGLSpan<const GCGLvoid>(data.baseAddress(), data.byteLength()));
#else
if (!validateTexFuncLevel("compressedTexSubImage2D", target, level))
return;
- if (!validateCompressedTexFormat(format)) {
- synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "compressedTexSubImage2D", "invalid format");
+ if (!validateCompressedTexFormat("compressedTexSubImage2D", format))
return;
- }
if (!validateCompressedTexFuncData("compressedTexSubImage2D", width, height, format, data))
return;
@@ -6693,12 +6692,17 @@
return 0;
}
-#if !USE(ANGLE)
-bool WebGLRenderingContextBase::validateCompressedTexFormat(GCGLenum format)
+bool WebGLRenderingContextBase::validateCompressedTexFormat(const char* functionName, GCGLenum format)
{
- return m_compressedTextureFormats.contains(format);
+ if (!m_compressedTextureFormats.contains(format)) {
+ synthesizeGLError(GraphicsContextGL::INVALID_ENUM, functionName, "invalid format");
+ return false;
+ }
+ return true;
}
+#if !USE(ANGLE)
+
struct BlockParameters {
const int width;
const int height;
Modified: branches/safari-612-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.h (284941 => 284942)
--- branches/safari-612-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.h 2021-10-27 21:05:20 UTC (rev 284941)
+++ branches/safari-612-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.h 2021-10-27 21:05:24 UTC (rev 284942)
@@ -978,10 +978,11 @@
// Helper function to validate compressed texture data is correct size
// for the given format and dimensions.
bool validateCompressedTexFuncData(const char* functionName, GCGLsizei width, GCGLsizei height, GCGLenum format, ArrayBufferView& pixels);
-
+#endif
// Helper function for validating compressed texture formats.
- bool validateCompressedTexFormat(GCGLenum format);
+ bool validateCompressedTexFormat(const char* functionName, GCGLenum format);
+#if !USE(ANGLE)
// Helper function to validate compressed texture dimensions are valid for
// the given format.
bool validateCompressedTexDimensions(const char* functionName, GCGLenum target, GCGLint level, GCGLsizei width, GCGLsizei height, GCGLenum format);