Bug 220098

Summary: [WinCairo][WebGL2] webgl/2.0.0/conformance2/textures tests are failing
Product: WebKit Reporter: Fujii Hironori <Hironori.Fujii>
Component: WebGLAssignee: Nobody <webkit-unassigned>
Severity: Normal CC: dino, geofflang, jdarpinian, jonahr, kbr, kkinnunen
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Description Flags
simplified tex-2d-rgba16f-rgba-float.html
[Screenshot] WinCairo port none

Description Fujii Hironori 2020-12-22 12:30:08 PST
[WinCairo][WebGL2] webgl/2.0.0/conformance2/textures tests are failing

Since WinCairo enables WebGL2 (Bug 192314).
Comment 1 Fujii Hironori 2020-12-22 12:31:58 PST
Created attachment 416680 [details]
simplified tex-2d-rgba16f-rgba-float.html

I created a repro by simplifying tex-2d-rgba16f-rgba-float.html.

1. Start WinCairo MiniBrowser
2. Open tex-2d-rgba16f-rgba-float.html
3. All tests pass
4. Reload
5. The third test fails (Infrequently, both the first and the third tests fail)
Comment 2 Kenneth Russell 2020-12-22 12:51:35 PST
CC'ing a few others.

Could you please copy/paste the log from the test? We don't have a setup for debugging this directly.

Have you run this in the inspector? Which operation exactly does it look like is failing?

Which test configuration exactly is failing? There are several subdirectories of conformance2/textures/ , each of which have tests named tex-2d-rgba16f-rgba-float.html.
Comment 3 Fujii Hironori 2020-12-22 13:21:28 PST
Created attachment 416684 [details]
[Screenshot] WinCairo port

The test expected black for the uninitialized texture area but green in the second load.
Comment 4 Fujii Hironori 2020-12-22 13:22:22 PST
(In reply to Kenneth Russell from comment #2)
> CC'ing a few others.

Thank you. This bug causes a lot of test failures, but I don't think
this bug is so critical. This bug seems that uninitialized texture
areas aren't black transparent. I'm going to enable WebGL2 for
WinCairo without fixing this bug and skipping the tests.

> Could you please copy/paste the log from the test?

Will do.

> We don't have a setup for debugging this directly.

I'm going to enable WebGL2 for WinCairo, you will be able to download
WinCairo binaries. You can try it if you have a Windows PC.


> Have you run this in the inspector? Which operation exactly does it look
> like is failing?

texSubImage2D[SubSource] and texSubImage3D[SubSource] tests are failing.
texSubImage2D and texSubImage3D don't work as expected in the SubSource case.
Comment 5 Kenneth Russell 2020-12-22 15:52:39 PST
It's actually critical that uninitialized resources like textures be zeroed out by ANGLE. Did you enable the EGL_ROBUST_RESOURCE_INITIALIZATION_ANGLE flag in your EGL context creation? See this code and nearby code in Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm :

    // WebGL requires that all resources are cleared at creation.

Ideally the WinCairo port should pick up all of these EGL initialization parameters.
Comment 6 Fujii Hironori 2020-12-22 17:04:55 PST
Bingo! It solves.
I'm going to land the fix together with Bug 192314.
Ideally, GraphicsContextGLOpenGLCocoa.mm should be in C++, and shared among all port.
Anyway, thank you very much.

*** This bug has been marked as a duplicate of bug 192314 ***