[webkit-changes] [WebKit/WebKit] 03a60b: REGRESSION (271770 at main): visionOS: Significant re...

Tim Horton noreply at github.com
Thu Feb 8 15:32:43 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 03a60be8929d23706595fd8fcaa834e3839912ae
      https://github.com/WebKit/WebKit/commit/03a60be8929d23706595fd8fcaa834e3839912ae
  Author: Tim Horton <thorton at apple.com>
  Date:   2024-02-08 (Thu, 08 Feb 2024)

  Changed paths:
    M Source/WebCore/SourcesCocoa.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/platform/graphics/ImageBuffer.h
    M Source/WebCore/platform/graphics/ImageBufferBackend.h
    M Source/WebCore/platform/graphics/cocoa/IOSurface.h
    A Source/WebCore/platform/graphics/re/DynamicContentScalingResourceCache.h
    A Source/WebCore/platform/graphics/re/DynamicContentScalingResourceCache.mm
    M Source/WebKit/Shared/RemoteLayerTree/DynamicContentScalingBifurcatedImageBuffer.mm
    M Source/WebKit/Shared/RemoteLayerTree/DynamicContentScalingImageBufferBackend.mm
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithInProcessRenderingBackingStore.h
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithInProcessRenderingBackingStore.mm

  Log Message:
  -----------
  REGRESSION (271770 at main): visionOS: Significant regression on MotionMark
https://bugs.webkit.org/show_bug.cgi?id=269010
rdar://122127093

Reviewed by Simon Fraser.

Before 271770 at main, the dynamic content scaling image buffer was a sidecar, outside
of the normal flow of the front/back buffer swapping. After that commit, it was moved
inside the main image buffer, and thus is swapped like the base scale rendering.

This had one unintended consequence: when we're discarding the back buffer
(e.g. because it contains an IOSurface that is still in-use and can't be recycled),
we will now *also* discard the dynamic content scaling image buffer, and, critically,
its resource cache.

The whole point of the resource cache is to maintain state between frames, so this is
wildly counterproductive. Once you get into a state where you are discarding
back buffers (which comes up frequently under load, like MotionMark), you're also
losing all resource caching.

Instead of trying to rearchitect the discarding code to avoid dropping the display
list image buffer, just maintain the dynamic content scaling resource cache
in a sidecar on the RemoteLayerBackingStore, like it was before, and pass it
down to the image buffer.

A subsequent patch will make a similar change for the remote rendering case.

* Source/WebCore/SourcesCocoa.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/graphics/cocoa/IOSurface.h:
* Source/WebCore/platform/graphics/re/DynamicContentScalingResourceCache.h: Added.
(WebCore::DynamicContentScalingResourceCache::DynamicContentScalingResourceCache):
* Source/WebCore/platform/graphics/re/DynamicContentScalingResourceCache.mm: Added.
(WebCore::DynamicContentScalingResourceCache::create):
* Source/WebKit/Shared/RemoteLayerTree/DynamicContentScalingBifurcatedImageBuffer.mm:
* Source/WebKit/Shared/RemoteLayerTree/DynamicContentScalingImageBufferBackend.mm:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithInProcessRenderingBackingStore.h:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithInProcessRenderingBackingStore.mm:
(WebKit::RemoteLayerWithInProcessRenderingBackingStore::ensureDynamicContentScalingResourceCache):
(WebKit::RemoteLayerWithInProcessRenderingBackingStore::allocateBuffer):
(WebKit::RemoteLayerWithInProcessRenderingBackingStore::allocateBuffer const): Deleted.

* Source/WebCore/platform/graphics/ImageBuffer.h:
* Source/WebCore/platform/graphics/ImageBufferBackend.h:
Note that it is not safe in a unified-sources world to forward-declare WebCore::IOSurface
because of the name conflict with ::IOSurface; we need to strictly order the declarations,
which is easiest to achieve by just importing our header.

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




More information about the webkit-changes mailing list