Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0598ff89081540941b9df0ce8eb89a2c57da1d5a
https://github.com/WebKit/WebKit/commit/0598ff89081540941b9df0ce8eb89a2c57da1d5a
Author: Kimmo Kinnunen <[email protected]>
Date: 2026-10-10 (Sat, 10 Oct 2026)
Changed paths:
M Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/RenderBufferMtl.mm
Log Message:
-----------
ANGLE: Metal: Renderbuffers are initialized with CPU
https://bugs.webkit.org/show_bug.cgi?id=326983
rdar://189606864
Reviewed by Mike Wyrzykowski.
With robust resource initialization enabled, ANGLE zero-fills an
uninitialized renderbuffer before it is read, drawn to or partially
cleared. RenderbufferMtl::initializeContents() did this through
mtl::InitializeTextureContents(), which writes CPU-accessible textures
from the CPU, one -[MTLTexture replaceRegion:...] call per row.
Single-sampled color renderbuffers have Shared storage, so they took
this path. The GPU may store such a texture in a tiled, compressed
layout, so the driver converts each row on the CPU. Profiling the
webgl/default-framebuffer-size-limits-*.html tests showed about 3.6
seconds of GPU process CPU time in the AGX driver's
processCompressedRegion2D, reached from
RenderbufferMtl::initializeContents().
Upstream ANGLE avoids this path with the Metal feature
alwaysPreferStagedTextureUploads, which also makes texture data uploads
go through staging buffers. WebKit disables that feature because of the
staging buffer allocations.
Clear color renderbuffers with a render pass instead, through
mtl::InitializeTextureContentsGPU(), when the format is
color-renderable. Depth and stencil renderbuffers are not CPU-accessible
and were already cleared on the GPU. Initialization and uploads of
textures are unchanged.
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/RenderBufferMtl.mm:
(rx::RenderbufferMtl::initializeContents):
Canonical link: https://commits.webkit.org/323297@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications