Title: [282097] trunk
Revision
282097
Author
[email protected]
Date
2021-09-07 11:03:53 -0700 (Tue, 07 Sep 2021)

Log Message

webgl/2.0.y/deqp/functional/gles3/negativestateapi.html get_framebuffer_attachment_parameter fails on Metal
https://bugs.webkit.org/show_bug.cgi?id=229947

Patch by Kimmo Kinnunen <[email protected]> on 2021-09-07
Reviewed by Kenneth Russell.

Source/WebCore:

Fix get_framebuffer_attachment_parameter part of
webgl/2.0.y/deqp/functional/gles3/negativestateapi.html.
The code was querying the attachment parameters of default framebuffer from ANGLE.
However, this is problematic as WebGL default framebuffer is emulated with
a FBO with texture and stencil attachment. As such, some properties returned
values that should have returned errors.
WebGL2 specification specifies all the properties that can be queried.
All these properties are known at the WebCore level, so just return them
there.
Failing test part was:
    gl.bindFramebuffer(gl.FRAMEBUFFER, null);
    gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);
    this.expectError(gl.INVALID_ENUM);
and:
    gl.bindFramebuffer(gl.FRAMEBUFFER, null);
    gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);
    this.expectError([gl.INVALID_OPERATION, gl.INVALID_ENUM]);

Tested by:
webgl/2.0.y/deqp/functional/gles3/negativestateapi.html

Does modify test expectations since the test fails in other, unrelated parts.

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):

LayoutTests:

The fix fixed the test partially. This would affect the test results.
WebGL tests do not commonly have partially succeeding test results, rather
the -expected.txt is always the "success".

webgl/2.0.0/deqp/functional/gles3/negativestateapi.html had its result generated with
buggy implementation, e.g. the result had failures listed. Regenerate the result and
add expected failure to test expectations instead.

* webgl/2.0.0/deqp/functional/gles3/negativestateapi-expected.txt:
Reset the expected.txt to test success instead of incorrect failure.
* webgl/TestExpectations:
Mark the test failing.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (282096 => 282097)


--- trunk/LayoutTests/ChangeLog	2021-09-07 18:00:38 UTC (rev 282096)
+++ trunk/LayoutTests/ChangeLog	2021-09-07 18:03:53 UTC (rev 282097)
@@ -1,3 +1,23 @@
+2021-09-07  Kimmo Kinnunen  <[email protected]>
+
+        webgl/2.0.y/deqp/functional/gles3/negativestateapi.html get_framebuffer_attachment_parameter fails on Metal
+        https://bugs.webkit.org/show_bug.cgi?id=229947
+
+        Reviewed by Kenneth Russell.
+
+        The fix fixed the test partially. This would affect the test results.
+        WebGL tests do not commonly have partially succeeding test results, rather
+        the -expected.txt is always the "success".
+
+        webgl/2.0.0/deqp/functional/gles3/negativestateapi.html had its result generated with
+        buggy implementation, e.g. the result had failures listed. Regenerate the result and
+        add expected failure to test expectations instead.
+
+        * webgl/2.0.0/deqp/functional/gles3/negativestateapi-expected.txt:
+        Reset the expected.txt to test success instead of incorrect failure.
+        * webgl/TestExpectations:
+        Mark the test failing.
+
 2021-09-07  Megan Gardner  <[email protected]>
 
         Rewrite long press and drag tests to be more robust.

Modified: trunk/LayoutTests/webgl/2.0.0/deqp/functional/gles3/negativestateapi-expected.txt (282096 => 282097)


--- trunk/LayoutTests/webgl/2.0.0/deqp/functional/gles3/negativestateapi-expected.txt	2021-09-07 18:00:38 UTC (rev 282096)
+++ trunk/LayoutTests/webgl/2.0.0/deqp/functional/gles3/negativestateapi-expected.txt	2021-09-07 18:03:53 UTC (rev 282097)
@@ -1,47 +1,4 @@
 This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
 
 Test: ../../../resources/webgl_test_files/deqp/functional/gles3/negativestateapi.html
-
-[ 1: PASS ] state.enable: Passed
-[ 2: PASS ] state.disable: Passed
-[ 3: PASS ] state.get_parameter: Passed
-[ 4: PASS ] state.get_indexed_parameter: Passed
-[ 5: PASS ] state.get_attached_shaders: Passed
-[ 6: PASS ] state.get_shader_parameter: Passed
-[ 7: PASS ] state.get_shader_info_log: Passed
-[ 8: PASS ] state.get_shader_precision_format: Passed
-[ 9: PASS ] state.get_shader_source: Passed
-[ 10: PASS ] state.get_program_parameter: Passed
-[ 11: PASS ] state.get_program_info_log: Passed
-[ 12: PASS ] state.get_tex_parameter: Passed
-[ 13: PASS ] state.get_uniform: Passed
-[ 14: PASS ] state.get_active_uniform: Passed
-[ 15: PASS ] state.get_active_uniforms: Passed
-[ 16: PASS ] state.get_active_uniform_block_parameter: Passed
-[ 17: PASS ] state.get_active_uniform_block_name: Passed
-[ 18: PASS ] state.get_active_attrib: Passed
-[ 19: PASS ] state.get_uniform_indices: Passed
-[ 20: PASS ] state.get_vertex_attrib: Passed
-[ 21: PASS ] state.get_vertex_attrib_offset: Passed
-[ 22: PASS ] state.get_frag_data_location: Passed
-[ 23: PASS ] state.get_buffer_parameter: Passed
-[ 24: FAIL ] state.get_framebuffer_attachment_parameter: Expected gl.INVALID_ENUM, but got gl.NO_ERROR.
-[ 25: PASS ] state.get_renderbuffer_parameter: Passed
-[ 26: PASS ] state.get_internalformat_parameter: Passed
-[ 27: PASS ] state.get_query: Passed
-[ 28: FAIL ] state.get_query_parameter: Expected gl.INVALID_OPERATION, but got gl.NO_ERROR.
-[ 29: PASS ] state.get_sync_parameter: Passed
-[ 30: PASS ] state.is_enabled: Passed
-[ 31: PASS ] state.is_buffer: Passed
-[ 32: PASS ] state.is_framebuffer: Passed
-[ 33: PASS ] state.is_program: Passed
-[ 34: PASS ] state.is_renderbuffer: Passed
-[ 35: PASS ] state.is_shader: Passed
-[ 36: PASS ] state.is_texture: Passed
-[ 37: PASS ] state.is_query: Passed
-[ 38: PASS ] state.is_sampler: Passed
-[ 39: PASS ] state.is_sync: Passed
-[ 40: PASS ] state.is_transform_feedback: Passed
-[ 41: PASS ] state.is_vertex_array: Passed
-[ 42: PASS ] state.is_vertex_array: successfullyParsed is true
-[ FAIL ] 2 failures reported
+[ PASS ] All tests passed

Modified: trunk/LayoutTests/webgl/TestExpectations (282096 => 282097)


--- trunk/LayoutTests/webgl/TestExpectations	2021-09-07 18:00:38 UTC (rev 282096)
+++ trunk/LayoutTests/webgl/TestExpectations	2021-09-07 18:03:53 UTC (rev 282097)
@@ -25,3 +25,4 @@
 webkit.org/b/228703 webgl/2.0.0/deqp/functional/gles3/fbomultisample.4_samples.html [ Failure ]
 webkit.org/b/228703 webgl/2.0.0/deqp/functional/gles3/fbomultisample.8_samples.html [ Failure ]
 webkit.org/b/228703 webgl/2.0.0/deqp/functional/gles3/shadertexturefunction/texturegrad.html [ Failure ]
+webkit.org/b/229982 webgl/2.0.0/deqp/functional/gles3/negativestateapi.html [ Failure ]
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (282096 => 282097)


--- trunk/Source/WebCore/ChangeLog	2021-09-07 18:00:38 UTC (rev 282096)
+++ trunk/Source/WebCore/ChangeLog	2021-09-07 18:03:53 UTC (rev 282097)
@@ -1,3 +1,36 @@
+2021-09-07  Kimmo Kinnunen  <[email protected]>
+
+        webgl/2.0.y/deqp/functional/gles3/negativestateapi.html get_framebuffer_attachment_parameter fails on Metal
+        https://bugs.webkit.org/show_bug.cgi?id=229947
+
+        Reviewed by Kenneth Russell.
+
+        Fix get_framebuffer_attachment_parameter part of
+        webgl/2.0.y/deqp/functional/gles3/negativestateapi.html.
+        The code was querying the attachment parameters of default framebuffer from ANGLE.
+        However, this is problematic as WebGL default framebuffer is emulated with
+        a FBO with texture and stencil attachment. As such, some properties returned
+        values that should have returned errors.
+        WebGL2 specification specifies all the properties that can be queried.
+        All these properties are known at the WebCore level, so just return them
+        there.
+        Failing test part was:
+            gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+            gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);
+            this.expectError(gl.INVALID_ENUM);
+        and:
+            gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+            gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);
+            this.expectError([gl.INVALID_OPERATION, gl.INVALID_ENUM]);
+
+        Tested by:
+        webgl/2.0.y/deqp/functional/gles3/negativestateapi.html
+
+        Does modify test expectations since the test fails in other, unrelated parts.
+
+        * html/canvas/WebGL2RenderingContext.cpp:
+        (WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
+
 2021-09-07  Commit Queue  <[email protected]>
 
         Unreviewed, reverting r282086.

Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp (282096 => 282097)


--- trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp	2021-09-07 18:00:38 UTC (rev 282096)
+++ trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp	2021-09-07 18:03:53 UTC (rev 282097)
@@ -2811,9 +2811,24 @@
 
         switch (pname) {
         case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
-            return GraphicsContextGL::FRAMEBUFFER_DEFAULT;
+            return static_cast<unsigned>(GraphicsContextGL::FRAMEBUFFER_DEFAULT);
+        case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_RED_SIZE:
+        case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:
+        case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:
+            return attachment == GraphicsContextGL::BACK ? 8 : 0;
+        case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:
+            return attachment == GraphicsContextGL::BACK && m_attributes.alpha ? 8 : 0;
+        case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:
+            return attachment == GraphicsContextGL::DEPTH ? 24 : 0;
+        case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:
+            return attachment == GraphicsContextGL::STENCIL ? 8 : 0;
+        case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:
+            return static_cast<unsigned>(GraphicsContextGL::UNSIGNED_NORMALIZED);
+        case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:
+            return static_cast<unsigned>(GraphicsContextGL::LINEAR);
         default:
-            return m_context->getFramebufferAttachmentParameteri(target, attachment, pname);
+            synthesizeGLError(GraphicsContextGL::INVALID_ENUM, functionName, "invalid parameter name");
+            return nullptr;
         }
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to