Bug 237883

Summary: [GTK][WPE] Use GBMBufferSwapchain in GraphicsContextGLTextureMapperANGLE
Product: WebKit Reporter: Zan Dobersek <zan>
Component: New BugsAssignee: Zan Dobersek <zan>
Status: RESOLVED FIXED    
Severity: Normal CC: alex, cmarcelo, dino, ews-watchlist, glenn, jbedard, kondapallykalyan, luiz, webkit-bug-importer, zdobersek
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 238322    
Bug Blocks: 237649    
Attachments:
Description Flags
WIP patch
none
WIP patch
none
WIP patch
none
WIP patch
none
Patch
none
Patch for landing none

Description Zan Dobersek 2022-03-15 04:20:08 PDT
For each ANGLE-produced WebGL frame, we'd want to retrieve a dmabuf buffer via GBMBufferSwapchain, impose it as the backing for the texture that's being used as the default framebuffer color attachment, and finally push it into the rendering pipeline once the frame is complete. Upon the next frame the swapchain would provide a different buffer, and the cycle repeats.
Comment 1 Zan Dobersek 2022-03-15 04:21:38 PDT
Created attachment 454692 [details]
WIP patch

Early, but functions on the most basic WebGL content. It still needs cleanup, proper understanding of what's used in different configurations sharing this code, and how other things like preserved-drawing-buffer affect this.
Comment 2 Zan Dobersek 2022-03-23 02:07:53 PDT
Created attachment 455475 [details]
WIP patch
Comment 3 Zan Dobersek 2022-03-24 05:19:45 PDT
Created attachment 455633 [details]
WIP patch
Comment 4 Zan Dobersek 2022-03-28 04:36:25 PDT
Created attachment 455901 [details]
WIP patch
Comment 5 Zan Dobersek 2022-03-28 07:01:19 PDT
Created attachment 455914 [details]
Patch
Comment 6 Alejandro G. Castro 2022-03-28 12:55:08 PDT
Comment on attachment 455914 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=455914&action=review

LGTM! Just check the unguarded line to make sure we do not break other compilations.

> Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:476
> +    m_swapchain.displayBO = WTFMove(m_swapchain.drawBO);

This needs to be guarded with the TEXTURE_MAPPER_DMABUF. It is causing the wincairo failure.
Comment 7 Zan Dobersek 2022-03-28 22:41:01 PDT
Created attachment 455994 [details]
Patch for landing
Comment 8 EWS 2022-03-29 01:00:44 PDT
Committed r292025 (248968@main): <https://commits.webkit.org/248968@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 455994 [details].
Comment 9 Radar WebKit Bug Importer 2022-03-29 01:01:18 PDT
<rdar://problem/90969336>