From 9d7fc9b7bedc2a2f05031e7779fbaec3c594be60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Le=20Page?= Date: Fri, 13 Jan 2023 20:01:09 +0100 Subject: [PATCH] [WPE][WebGL][Canvas][Compositing] Fix partially rendered WebGL canvas composition https://bugs.webkit.org/show_bug.cgi?id=250314 Reviewed by NOBODY (OOPS!). When rendering heavy 3D scenes in a WebGL canvas using the WPE EGL renderer, the compositor may use the element render target texture BEFORE all the WebGL commands are correctly executed by the GPU. Then, on most complex frames, the canvas appears totally blank or partially rendered. This patch ensures that all GL commands from the WebGL canvas context are finished before using the render target texture in the compositor. * Source/WebCore/platform/graphics/gbm/GraphicsContextGLGBM.cpp: (WebCore::GraphicsContextGLGBM::prepareTexture): --- Source/WebCore/platform/graphics/gbm/GraphicsContextGLGBM.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/WebCore/platform/graphics/gbm/GraphicsContextGLGBM.cpp b/Source/WebCore/platform/graphics/gbm/GraphicsContextGLGBM.cpp index 1bdecdbc2cd9..ab1927c2748a 100644 --- a/Source/WebCore/platform/graphics/gbm/GraphicsContextGLGBM.cpp +++ b/Source/WebCore/platform/graphics/gbm/GraphicsContextGLGBM.cpp @@ -267,7 +267,7 @@ void GraphicsContextGLGBM::prepareTexture() if (contextAttributes().antialias) resolveMultisamplingIfNecessary(); - GL_Flush(); + GL_Finish(); } bool GraphicsContextGLGBM::reshapeDisplayBufferBacking()