OpenGL ES3 support is there in ANGLE so we can enable WebGL 2 for windows.
Created attachment 414850 [details] WIP patch
Created attachment 414973 [details] WIP patch
Created attachment 415189 [details] WIP patch
Created attachment 416390 [details] WIP patch A lot of tests are failing under webgl/2.0.0/conformance2/textures, for example, webgl/2.0.0/conformance2/textures/image_bitmap_from_image/tex-2d-r16f-red-float.html [ Failure ] webgl/2.0.0/conformance2/textures/image_bitmap_from_image/tex-2d-r16f-red-half_float.html [ Failure ] webgl/2.0.0/conformance2/textures/image_bitmap_from_image/tex-2d-r32f-red-float.html [ Failure ] webgl/2.0.0/conformance2/textures/image_bitmap_from_image/tex-2d-r8-red-unsigned_byte.html [ Failure ]
Several bug fixes made all of the ImageBitmap tests pass on Apple's port. Is platform-specific code needed to make ImageBitmap work correctly on WinCairo?
Thanks, Ken. I don't know the answer. Will check.
(In reply to Fujii Hironori from comment #4) > A lot of tests are failing under webgl/2.0.0/conformance2/textures, for > example, Only texSubImage2D[SubSource] tests are failing. There are suspicious FIXME comments in WebGLRenderingContextBase::texImageSourceHelper for Cairo ports. > // FIXME: Enable this path with ANGLE. Only used with Cairo, not on macOS or iOS. > // If possible, copy from the bitmap directly to the texture > // via the GPU, without a read-back to system memory. > // > // FIXME: restriction of (RGB || RGBA)/UNSIGNED_BYTE should be lifted when > // ImageBuffer::copyToPlatformTexture implementations are fully functional.
(In reply to Fujii Hironori from comment #7) > (In reply to Fujii Hironori from comment #4) > > A lot of tests are failing under webgl/2.0.0/conformance2/textures, for > > example, > > Only texSubImage2D[SubSource] tests are failing. > There are suspicious FIXME comments in > WebGLRenderingContextBase::texImageSourceHelper for Cairo ports. > > > // FIXME: Enable this path with ANGLE. Only used with Cairo, not on macOS or iOS. > > // If possible, copy from the bitmap directly to the texture > > // via the GPU, without a read-back to system memory. > > // > > // FIXME: restriction of (RGB || RGBA)/UNSIGNED_BYTE should be lifted when > > // ImageBuffer::copyToPlatformTexture implementations are fully functional. Ah, yes. That code path tries to handle the case where the ImageBitmap is backed by a GPU texture, and tries to copy it directly to the destination WebGL texture. Could you see whether the extension in Source/ThirdParty/ANGLE/extensions/CHROMIUM_copy_texture.txt provides the needed functionality, and lets you skip the query of the texture's internal format? With the ANGLE backend, WebGLTextures don't track their internal format any more. Note, I would have thought that the fall-through case (which uses CPU readbacks) would have at least made the tests pass, even if they're slower than desired. Could you investigate exactly what's going wrong with the texSubImage2D[SubSource] tests?
Created attachment 416623 [details] The failure result of tex-2d-r16f-red-float.html This is a result of webgl/2.0.0/resources/webgl_test_files/conformance2/textures/image_bitmap_from_canvas/tex-2d-r16f-red-float.html. There are 8 texSubImage2D[SubSource] tests, and all are failing. There are 10 FAILs, all expected black but red. I guess this is a SubSource dimension issue because other tests are passing. my two cents.
(In reply to Kenneth Russell from comment #8) > Could you see whether the extension in > Source/ThirdParty/ANGLE/extensions/CHROMIUM_copy_texture.txt provides the > needed functionality, I have to admit I don't understand. How to check it? > and lets you skip the query of the texture's internal > format? With the ANGLE backend, WebGLTextures don't track their internal > format any more. How to skip?
Created attachment 416626 [details] layout-test-results for image_bitmap_from_canvas This is layout-test-results for the following command. > python ./Tools/Scripts/run-webkit-tests --debug --wincairo --no-new-test-results --no-retry-failures webgl/2.0.0/conformance2/textures/image_bitmap_from_canvas -1
Created attachment 416627 [details] run-webkit-tests output for image_bitmap_from_canvas > 16 tests ran as expected, 50 didn't:
(In reply to Fujii Hironori from comment #12) > > 16 tests ran as expected, 50 didn't: I seems that only WebGL1 compatible pixel formats are passing. I'm initializing WebGL2 ANGLE context with a sharing context with TextureMapper to composite. It's suspicious.
I tried both disabling sharing a context and using ES v3 for compositing, but no luck. 🤷♂️
Created attachment 416646 [details] simplified tex-2d-rgba16f-rgba-float.html 1. Start WinCairo MiniBroser 2. Open tex-2d-rgba16f-rgba-float.html 3. All tests pass 4. Reload 5. The third test fails
Created attachment 416649 [details] simplified tex-2d-rgba16f-rgba-float.html
Filed the issue as a new bug: Bug 220098 – [WinCairo][WebGL2] webgl/2.0.0/conformance2/textures tests are failing
*** Bug 220098 has been marked as a duplicate of this bug. ***
Created attachment 416702 [details] WIP patch
Created attachment 416704 [details] Patch
Comment on attachment 416704 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=416704&action=review Hooray! Glad this is working! r+ > Source/WebCore/platform/graphics/texmap/ANGLEContext.cpp:133 > + contextAttributes.append(EGL_FALSE); Per your comment on https://bugs.webkit.org/show_bug.cgi?id=220098 - if you can find a way to refactor this ANGLE EGL context initialization code so it can be shared among all ports, that would be very welcome.
Comment on attachment 416704 [details] Patch Clearing flags on attachment: 416704 Committed r271075: <https://trac.webkit.org/changeset/271075>
All reviewed patches have been landed. Closing bug.
<rdar://problem/72631792>
I was motivated by your presentation in the WebKit contributors conference. I'm so happy that WinCairo also enables WebGL2 today. Thank you very much for the review and assistance.