Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e19beafbaf11999a5816707a83b97903b0a13535
https://github.com/WebKit/WebKit/commit/e19beafbaf11999a5816707a83b97903b0a13535
Author: Sergio Villar Senin <[email protected]>
Date: 2026-09-29 (Tue, 29 Sep 2026)
Changed paths:
M Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp
M Source/WebCore/platform/graphics/android/GraphicsContextGLAndroid.cpp
M Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp
M Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.h
M Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.h
M Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm
M Source/WebCore/platform/graphics/gbm/GraphicsContextGLGBM.cpp
Log Message:
-----------
[WebXR] Discard MSAA attachments after rendering
https://bugs.webkit.org/show_bug.cgi?id=324239
Reviewed by Kimmo Kinnunen.
In order to implement MSAA in WebXR, WebKit uses a multisampled
renderbuffer. Render buffers are write-only objects, nobody is going to
read from them after the contents are resolved. On tile-based rendering
GPUs, after a render pass is completed, the contents of the renderbuffer
are saved into RAM because the OpenGL driver does not know whether it
can simply discard them. For a 3200*1600 framebuffer with 4x MSAA that's
82Mb written per frame (actually 82 + 82 if depth/stencil are used too).
That's a very expensive operation that adds nothing and should be
avoided.
The fix is to do the same as VisionOS, discard the render buffer
attachments before finishing the render pass. VisionOS does not even
need the blit as that port uses a special ANGLE extension for Metal
backend that gives an FBO a resolve destination alongside its
multisampled attachment.
No new tests as this operates at OpenGLES driver level.
* Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp:
(WebCore::WebXROpaqueFramebuffer::resolveMSAAFramebuffer):
* Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::framebufferDiscard):
* Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.h:
*
Source/WebCore/platform/graphics/android/GraphicsContextGLTextureMapperAndroid.cpp:
(WebCore::GraphicsContextGLTextureMapperAndroid::enableRequiredWebXRExtensionsImpl):
* Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.h:
* Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::GraphicsContextGLCocoa::framebufferDiscard): Deleted.
* Source/WebCore/platform/graphics/gbm/GraphicsContextGLTextureMapperGBM.cpp:
(WebCore::GraphicsContextGLTextureMapperGBM::enableRequiredWebXRExtensionsImpl):
Canonical link: https://commits.webkit.org/322147@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications