Title: [282160] trunk
Revision
282160
Author
[email protected]
Date
2021-09-08 11:36:22 -0700 (Wed, 08 Sep 2021)

Log Message

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.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (282159 => 282160)


--- trunk/LayoutTests/ChangeLog	2021-09-08 18:30:55 UTC (rev 282159)
+++ trunk/LayoutTests/ChangeLog	2021-09-08 18:36:22 UTC (rev 282160)
@@ -1,3 +1,23 @@
+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-09-08  Ayumi Kojima  <[email protected]>
 
         [ BigSur wk1 ] webrtc/datachannel/datachannel-page-cache-send.html is a flaky timeout.

Modified: trunk/LayoutTests/webgl/TestExpectations (282159 => 282160)


--- trunk/LayoutTests/webgl/TestExpectations	2021-09-08 18:30:55 UTC (rev 282159)
+++ trunk/LayoutTests/webgl/TestExpectations	2021-09-08 18:36:22 UTC (rev 282160)
@@ -27,6 +27,8 @@
 webkit.org/b/228703 webgl/2.0.0/deqp/functional/gles3/shadertexturefunction/texturegrad.html [ Failure ]
 
 # 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/negativestateapi.html [ Pass ]
 webgl/2.0.y/deqp/functional/gles3/rbostatequery.html [ Pass ]
 webgl/2.0.y/deqp/functional/gles3/negativetextureapi.html [ Pass ]

Modified: trunk/LayoutTests/webgl/webgl-allow-shared-expected.txt (282159 => 282160)


--- trunk/LayoutTests/webgl/webgl-allow-shared-expected.txt	2021-09-08 18:30:55 UTC (rev 282159)
+++ trunk/LayoutTests/webgl/webgl-allow-shared-expected.txt	2021-09-08 18:36:22 UTC (rev 282160)
@@ -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: trunk/Source/WebCore/ChangeLog (282159 => 282160)


--- trunk/Source/WebCore/ChangeLog	2021-09-08 18:30:55 UTC (rev 282159)
+++ trunk/Source/WebCore/ChangeLog	2021-09-08 18:36:22 UTC (rev 282160)
@@ -1,3 +1,26 @@
+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-09-08  Manuel Rego Casasnovas  <[email protected]>
 
         [css-text-decor] text-decoration-* properties are no longer experimental

Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp (282159 => 282160)


--- trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp	2021-09-08 18:30:55 UTC (rev 282159)
+++ trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp	2021-09-08 18:36:22 UTC (rev 282160)
@@ -1364,6 +1364,8 @@
     }
     if (!validateTexture2DBinding("compressedTexImage2D", target))
         return;
+    if (!validateCompressedTexFormat("compressedTexImage2D", internalformat))
+        return;
     m_context->compressedTexImage2D(target, level, internalformat, width, height, border, imageSize, offset);
 }
 

Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (282159 => 282160)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp	2021-09-08 18:30:55 UTC (rev 282159)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp	2021-09-08 18:36:22 UTC (rev 282160)
@@ -1905,16 +1905,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;
@@ -1950,14 +1949,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;
 
@@ -6835,12 +6834,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: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h (282159 => 282160)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h	2021-09-08 18:30:55 UTC (rev 282159)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h	2021-09-08 18:36:22 UTC (rev 282160)
@@ -976,10 +976,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);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to