Skip to content
Permalink
Browse files
[GBM] Overzealous attaching of GL texture as color attachment to the …
…default framebuffer

https://bugs.webkit.org/show_bug.cgi?id=241462

Patch by Žan Doberšek <zdobersek@igalia.com> on 2022-06-13
Reviewed by Alejandro G. Castro.

In GraphicsContextGLGBM::prepareTexture(), there's no need to repeatedly
reattach the texture objec to the default framebuffer. With GraphicsContextGLGBM
this is only done when (re)sizing the framebuffer. The attached texture later
isn't switched out for some other texture, it remains in place. What does change
is the backing DMABuf-based EGLImage, which is updated upon the next
make-context-current request.

This means framebuffer operations here, after any required multisampling is
resolved, are not required. Only thing that remains is the GL_Flush() call.

* Source/WebCore/platform/graphics/gbm/GraphicsContextGLGBM.cpp:
(WebCore::GraphicsContextGLGBM::prepareTexture):

Canonical link: https://commits.webkit.org/251489@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
commit-queue@webkit.org committed Jun 13, 2022
1 parent e3e4479 commit 1fdca141d1e47e27131d244f6c2ae5eae2530c3c
Showing 1 changed file with 0 additions and 5 deletions.
@@ -355,12 +355,7 @@ void GraphicsContextGLGBM::prepareTexture()
if (contextAttributes().antialias)
resolveMultisamplingIfNecessary();

GL_BindFramebuffer(GL_FRAMEBUFFER, m_fbo);
GL_FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, drawingBufferTextureTarget(), m_texture, 0);
GL_Flush();

if (m_state.boundDrawFBO != m_fbo)
GL_BindFramebuffer(GraphicsContextGL::FRAMEBUFFER, m_state.boundDrawFBO);
}

bool GraphicsContextGLGBM::reshapeDisplayBufferBacking()

0 comments on commit 1fdca14

Please sign in to comment.