[webkit-changes] [WebKit/WebKit] ef391b: [ANGLE] Lose Metal-backed contexts

Dan Glastonbury noreply at github.com
Thu Jul 27 19:41:18 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ef391b1f467b031966e80a252b925e04b99556ba
      https://github.com/WebKit/WebKit/commit/ef391b1f467b031966e80a252b925e04b99556ba
  Author: Dan Glastonbury <djg at apple.com>
  Date:   2023-07-27 (Thu, 27 Jul 2023)

  Changed paths:
    M Source/ThirdParty/ANGLE/changes.diff
    M Source/ThirdParty/ANGLE/src/libANGLE/features.h
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ContextMtl.mm
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/DisplayMtl.mm
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_command_buffer.h
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_command_buffer.mm

  Log Message:
  -----------
  [ANGLE] Lose Metal-backed contexts
https://bugs.webkit.org/show_bug.cgi?id=257584
rdar://109176858

Reviewed by Dean Jackson.

ANGLE provides a mechanism for determing if there has been a error with the
renderer backend via the DisplayImpl::testDeviceLost() and
ContextImpl::getResetStatus() APIs. The Metal renderer backend never signals an
error.

Metal provides a status on command buffer completion to signal if there has been
an error when processing a MTLCommandBuffer. This patch adds experimental
support for losing the context when this status signals there was an error. The
context can't be recovered once it is lost and needs to be recreated.

The feature is available when ANGLE_METAL_LOSE_CONTEXT_ON_ERROR is defined when
compiling ANGLE.

* Source/ThirdParty/ANGLE/src/libANGLE/features.h:
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/DisplayMtl.mm:
(rx::DisplayMtl::testDeviceLost):
(rx::DisplayMtl::restoreLostDevice):
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_command_buffer.h:
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_command_buffer.mm:
(rx::mtl::CommandQueue::onCommandBufferCompleted):

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




More information about the webkit-changes mailing list