[webkit-changes] [WebKit/WebKit] 3b9112: GPUP WebGL spends too much time allocating IOSurfaces

Kimmo Kinnunen noreply at github.com
Fri Apr 28 04:14:58 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3b9112ff64a6aa1c0daf62390d1646bcc36b488b
      https://github.com/WebKit/WebKit/commit/3b9112ff64a6aa1c0daf62390d1646bcc36b488b
  Author: Kimmo Kinnunen <kkinnunen at apple.com>
  Date:   2023-04-28 (Fri, 28 Apr 2023)

  Changed paths:
    M Source/WebCore/PlatformMac.cmake
    M Source/WebCore/SourcesCocoa.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    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
    R Source/WebCore/platform/graphics/cocoa/GraphicsContextGLIOSurfaceSwapChain.cpp
    R Source/WebCore/platform/graphics/cocoa/GraphicsContextGLIOSurfaceSwapChain.h
    M Source/WebCore/platform/graphics/cocoa/WebProcessGraphicsContextGLCocoa.mm
    M Source/WebCore/platform/graphics/gbm/GraphicsContextGLFallback.cpp
    M Source/WebCore/platform/graphics/gbm/GraphicsContextGLFallback.h
    M Source/WebCore/platform/graphics/gbm/GraphicsContextGLGBM.cpp
    M Source/WebCore/platform/graphics/gbm/GraphicsContextGLGBM.h
    M Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp
    M Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.h
    M Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLCocoa.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/cocoa/TestGraphicsContextGLCocoa.mm

  Log Message:
  -----------
  GPUP WebGL spends too much time allocating IOSurfaces
https://bugs.webkit.org/show_bug.cgi?id=255860
rdar://108444431

Reviewed by Simon Fraser.

Creating MachSendRight out of IOSurface guarantees that the surface
is marked as in use for the lifetime of the surface. Trust this to
recycle the display buffers as drawing buffers in the GPUP mode.

Increase the held buffers to 3 surfaces per context. Otherwise the
buffers are never recycled, rather always reallocated. The new frame
is always being drawn while the previous frame is still being
composited.

Removes GraphicsContextGLIOSurfaceSwapChain, it is not a useful
abstraction. This was used temporarily when all the OpenGL variants
used the same implementation files.

Renames incorrect naming "DisplayBuffer" to "DrawingBuffer". The code
actually meant "current drawing buffer that will be display buffer
in the future".

* Source/WebCore/SourcesCocoa.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::reshapeFBOs):
* Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.h:
* Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.h:
* Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::GraphicsContextGLCocoa::~GraphicsContextGLCocoa):
(WebCore::GraphicsContextGLANGLE::~GraphicsContextGLANGLE):
(WebCore::GraphicsContextGLCocoa::reshapeDrawingBuffer):
(WebCore::GraphicsContextGLCocoa::setDrawingBufferColorSpace):
(WebCore::GraphicsContextGLCocoa::displayBuffer):
(WebCore::GraphicsContextGLCocoa::drawingBuffer):
(WebCore::GraphicsContextGLCocoa::bindNextDrawingBuffer):
(WebCore::GraphicsContextGLCocoa::freeDrawingBuffers):
(WebCore::GraphicsContextGLCocoa::prepareForDisplay):
(WebCore::GraphicsContextGLCocoa::readCompositedResults):
(WebCore::GraphicsContextGLCocoa::paintCompositedResultsToVideoFrame):
(WebCore::GraphicsContextGLCocoa::withDrawingBufferAsNativeImage):
(WebCore::GraphicsContextGLCocoa::withDisplayBufferAsNativeImage):
(WebCore::GraphicsContextGLCocoa::markDisplayBufferInUse): Deleted.
(WebCore::GraphicsContextGLCocoa::reshapeDisplayBufferBacking): Deleted.
(WebCore::GraphicsContextGLCocoa::allocateAndBindDisplayBufferBacking): Deleted.
(WebCore::GraphicsContextGLCocoa::bindDisplayBufferBacking): Deleted.
(WebCore::GraphicsContextGLANGLE::readCompositedResults): Deleted.
* Source/WebCore/platform/graphics/cocoa/GraphicsContextGLIOSurfaceSwapChain.cpp: Removed.
* Source/WebCore/platform/graphics/cocoa/GraphicsContextGLIOSurfaceSwapChain.h: Removed.
* Source/WebCore/platform/graphics/cocoa/WebProcessGraphicsContextGLCocoa.mm:
* Source/WebCore/platform/graphics/gbm/GraphicsContextGLFallback.cpp:
(WebCore::GraphicsContextGLFallback::reshapeDrawingBuffer):
(WebCore::GraphicsContextGLFallback::reshapeDisplayBufferBacking): Deleted.
* Source/WebCore/platform/graphics/gbm/GraphicsContextGLFallback.h:
* Source/WebCore/platform/graphics/gbm/GraphicsContextGLGBM.cpp:
(WebCore::GraphicsContextGLGBM::reshapeDrawingBuffer):
(WebCore::GraphicsContextGLGBM::reshapeDisplayBufferBacking): Deleted.
* Source/WebCore/platform/graphics/gbm/GraphicsContextGLGBM.h:
* Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
(WebCore::GraphicsContextGLTextureMapperANGLE::reshapeDrawingBuffer):
(WebCore::GraphicsContextGLTextureMapperANGLE::reshapeDisplayBufferBacking): Deleted.
* Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.h:
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLCocoa.cpp:
(WebKit::RemoteGraphicsContextGLCocoa::prepareForDisplay):
* Tools/TestWebKitAPI/Tests/WebCore/cocoa/TestGraphicsContextGLCocoa.mm:
(TestWebKitAPI::TEST_P):

Canonical link: https://commits.webkit.org/263496@main




More information about the webkit-changes mailing list