Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 606967dd83de240185d0a057c06725572478321d
      
https://github.com/WebKit/WebKit/commit/606967dd83de240185d0a057c06725572478321d
  Author: Dan Glastonbury <d...@apple.com>
  Date:   2024-07-01 (Mon, 01 Jul 2024)

  Changed paths:
    M Source/ThirdParty/ANGLE/Configurations/BaseTarget.xcconfig
    M Source/ThirdParty/ANGLE/doc/ExtensionSupport.md
    M Source/ThirdParty/ANGLE/include/GLES2/gl2ext_angle.h
    M 
Source/ThirdParty/ANGLE/scripts/code_generation_hashes/GL_EGL_entry_points.json
    M 
Source/ThirdParty/ANGLE/scripts/code_generation_hashes/interpreter_utils.json
    M Source/ThirdParty/ANGLE/scripts/entry_point_packed_gl_enums.json
    M Source/ThirdParty/ANGLE/scripts/gl_angle_ext.xml
    M Source/ThirdParty/ANGLE/scripts/registry_xml.py
    M Source/ThirdParty/ANGLE/src/common/entry_points_enum_autogen.cpp
    M Source/ThirdParty/ANGLE/src/common/entry_points_enum_autogen.h
    M Source/ThirdParty/ANGLE/src/libANGLE/Context.cpp
    M Source/ThirdParty/ANGLE/src/libANGLE/Context_gles_ext_autogen.h
    M Source/ThirdParty/ANGLE/src/libANGLE/Framebuffer.cpp
    M Source/ThirdParty/ANGLE/src/libANGLE/Framebuffer.h
    M Source/ThirdParty/ANGLE/src/libANGLE/capture/capture_gles_ext_autogen.cpp
    M Source/ThirdParty/ANGLE/src/libANGLE/capture/capture_gles_ext_autogen.h
    M Source/ThirdParty/ANGLE/src/libANGLE/gles_extensions_autogen.cpp
    M Source/ThirdParty/ANGLE/src/libANGLE/gles_extensions_autogen.h
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/BUILD.gn
    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/FrameBufferMtl.h
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/FrameBufferMtl.mm
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/RenderTargetMtl.h
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/RenderTargetMtl.mm
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_command_buffer.mm
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_state_cache.h
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_state_cache.mm
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_utils.mm
    M Source/ThirdParty/ANGLE/src/libANGLE/validationESEXT.cpp
    M Source/ThirdParty/ANGLE/src/libANGLE/validationESEXT_autogen.h
    M Source/ThirdParty/ANGLE/src/libGLESv2/entry_points_gles_ext_autogen.cpp
    M Source/ThirdParty/ANGLE/src/libGLESv2/entry_points_gles_ext_autogen.h
    M Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2_autogen.cpp
    M Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2_autogen.def
    M Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2_no_capture_autogen.def
    M 
Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2_vulkan_secondaries_autogen.def
    M Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2_with_capture_autogen.def
    M Source/ThirdParty/ANGLE/src/libGLESv2/opengl32_autogen.def
    M Source/ThirdParty/ANGLE/src/libGLESv2/opengl32_with_wgl_autogen.def
    M Source/ThirdParty/ANGLE/src/libGLESv2/proc_table_egl_autogen.cpp
    M Source/ThirdParty/ANGLE/src/libGLESv2/proc_table_glx_autogen.cpp
    M Source/ThirdParty/ANGLE/src/libGLESv2/proc_table_wgl_autogen.cpp
    M Source/ThirdParty/ANGLE/src/tests/angle_end2end_tests.gni
    M Source/ThirdParty/ANGLE/util/capture/frame_capture_replay_autogen.cpp
    M Source/ThirdParty/ANGLE/util/capture/trace_gles_loader_autogen.cpp
    M Source/ThirdParty/ANGLE/util/capture/trace_gles_loader_autogen.h
    M Source/ThirdParty/ANGLE/util/capture/trace_interpreter_autogen.cpp
    M Source/ThirdParty/ANGLE/util/gles_loader_autogen.cpp
    M Source/ThirdParty/ANGLE/util/gles_loader_autogen.h
    M Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.h
    M Source/WebCore/Modules/webxr/WebXROpaqueFramebufferCocoa.cpp
    M Source/WebCore/platform/graphics/GraphicsContextGL.cpp
    M Source/WebCore/platform/graphics/GraphicsContextGL.h
    M Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.h
    M Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm
    M Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.messages.in
    M 
Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.h
    M Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h
    M 
Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.cpp

  Log Message:
  -----------
  [WebXR] Implement explicit resolve of WebXR MSAA Rendertarget
https://bugs.webkit.org/show_bug.cgi?id=274137
rdar://128041507

Reviewed by Mike Wyrzykowski.

GL requires a glBlitFramebuffer to resolve MSAA render targets into
single-sample render targets. Internally, ANGLE's Metal backend has an implicit
resolve target that it allocates, which becomes the source for the
glBlitFramebuffer operation. GPU profiling data captured from device shows that
a large amount of time and memory bandwidth is being used to store both MSAA and
single-sample render targets, as well as, the blit operation. We would like to
avoid this and use Metal's render pass resolve target and discard the MSAA data
at the end of rendering.

In lieu of ANGLE's Metal backend being able to optimize this GL API usage
pattern to use render pass resolve target, this change makes use of a custom
extension to explicitly set the renderbuffer to use as resolve target in
the Metal renderer instead of the implicit render target, with:

    glFramebufferResolveRenderbufferWEBKIT(...)

Using this API removes the need to use glBlitFramebuffer variants to resolve
multiple samples to a single sample, and in combination with
glDiscardFramebufferEXT/glInvalidateFramebuffer, can avoid the cost of storing
MSAA buffers at the end of rendering.

This is not an long term solution and not intended for upstreaming to the ANGLE
project, as we're not interested in supporting all the combinations a general
API would require. The long term solution is to teach ANGLE's Metal backend to
optimize away the glBlitFramebuffer resolve step, just as ANGLE's Vulkan backend
is able to do.

* Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj:
* Source/ThirdParty/ANGLE/Configurations/BaseTarget.xcconfig:
* Source/ThirdParty/ANGLE/doc/ExtensionSupport.md:
* Source/ThirdParty/ANGLE/include/GLES2/gl2ext_angle.h:
* 
Source/ThirdParty/ANGLE/scripts/code_generation_hashes/GL_EGL_entry_points.json:
* Source/ThirdParty/ANGLE/scripts/code_generation_hashes/interpreter_utils.json:
* Source/ThirdParty/ANGLE/scripts/entry_point_packed_gl_enums.json:
* Source/ThirdParty/ANGLE/scripts/gl_angle_ext.xml:
* Source/ThirdParty/ANGLE/scripts/registry_xml.py:
* Source/ThirdParty/ANGLE/src/common/entry_points_enum_autogen.cpp:
(angle::GetEntryPointName):
* Source/ThirdParty/ANGLE/src/common/entry_points_enum_autogen.h:
* Source/ThirdParty/ANGLE/src/libANGLE/Context.cpp:
(gl::Context::framebufferResolveRenderbufferWEBKIT):
* Source/ThirdParty/ANGLE/src/libANGLE/Context_gles_ext_autogen.h:
* Source/ThirdParty/ANGLE/src/libANGLE/Framebuffer.cpp:
(gl::FramebufferState::FramebufferState):
(gl::FramebufferState::getColorResolveAttachment const):
(gl::FramebufferState::getDepthResolveAttachment const):
(gl::FramebufferState::getStencilResolveAttachment const):
(gl::Framebuffer::Framebuffer):
(gl::Framebuffer::onDestroy):
(gl::Framebuffer::getColorResolveAttachment const):
(gl::Framebuffer::getDepthResolveAttachment const):
(gl::Framebuffer::getStencilResolveAttachment const):
(gl::Framebuffer::setAttachmentResolve):
(gl::Framebuffer::updateAttachmentResolve):
(gl::Framebuffer::resetAttachmentResolve):
* Source/ThirdParty/ANGLE/src/libANGLE/Framebuffer.h:
* Source/ThirdParty/ANGLE/src/libANGLE/capture/capture_gles_ext_autogen.cpp:
(gl::CaptureFramebufferResolveRenderbufferWEBKIT):
* Source/ThirdParty/ANGLE/src/libANGLE/capture/capture_gles_ext_autogen.h:
* Source/ThirdParty/ANGLE/src/libANGLE/gles_extensions_autogen.cpp:
(gl::GetExtensionInfoMap):
* Source/ThirdParty/ANGLE/src/libANGLE/gles_extensions_autogen.h:
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/BUILD.gn:
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ContextMtl.mm:
(rx::ContextMtl::bindMetalRasterizationRateMap):
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/DisplayMtl.mm:
(rx::DisplayMtl::initializeExtensions const):
(rx::DisplayMtl::initializeFeatures):
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/FrameBufferMtl.h:
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/FrameBufferMtl.mm:
(rx::FramebufferMtl::FramebufferMtl):
(rx::FramebufferMtl::reset):
(rx::FramebufferMtl::setLoadStoreActionOnRenderPassFirstStart):
(rx::FramebufferMtl::updateColorRenderTarget):
(rx::FramebufferMtl::updateDepthRenderTarget):
(rx::FramebufferMtl::updateStencilRenderTarget):
(rx::FramebufferMtl::prepareRenderPass):
(rx::FramebufferMtl::clearWithLoadOpRenderPassNotStarted):
(rx::FramebufferMtl::invalidateImpl):
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/RenderTargetMtl.h:
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/RenderTargetMtl.mm:
(rx::RenderTargetMtl::toRenderPassAttachmentDesc const):
(rx::RenderTargetMtl::toRenderPassResolveAttachmentDesc const):
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_command_buffer.mm:
(rx::mtl::RenderCommandEncoder::initAttachmentWriteDependencyAndScissorRect):
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_state_cache.h:
(rx::mtl::RenderPassAttachmentDesc::hasResolveTexture const):
(rx::mtl::RenderPassAttachmentDesc::hasImplicitMSTexture const): Deleted.
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_state_cache.mm:
(rx::mtl::RenderPassAttachmentDesc::reset):
(rx::mtl::RenderPassAttachmentDesc::equalIgnoreLoadStoreOptions const):
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_utils.mm:
* Source/ThirdParty/ANGLE/src/libANGLE/validationESEXT.cpp:
(gl::ValidateFramebufferResolveRenderbufferWEBKIT):
* Source/ThirdParty/ANGLE/src/libANGLE/validationESEXT_autogen.h:
* Source/ThirdParty/ANGLE/src/libGLESv2/entry_points_gles_ext_autogen.cpp:
* Source/ThirdParty/ANGLE/src/libGLESv2/entry_points_gles_ext_autogen.h:
* Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2_autogen.cpp:
* Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2_autogen.def:
* Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2_no_capture_autogen.def:
* 
Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2_vulkan_secondaries_autogen.def:
* Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2_with_capture_autogen.def:
* Source/ThirdParty/ANGLE/src/libGLESv2/opengl32_autogen.def:
* Source/ThirdParty/ANGLE/src/libGLESv2/opengl32_with_wgl_autogen.def:
* Source/ThirdParty/ANGLE/src/libGLESv2/proc_table_egl_autogen.cpp:
* Source/ThirdParty/ANGLE/src/libGLESv2/proc_table_glx_autogen.cpp:
* Source/ThirdParty/ANGLE/src/libGLESv2/proc_table_wgl_autogen.cpp:
* Source/ThirdParty/ANGLE/src/tests/angle_end2end_tests.gni:
* Source/ThirdParty/ANGLE/util/capture/frame_capture_replay_autogen.cpp:
(angle::ReplayTraceFunctionCall):
* Source/ThirdParty/ANGLE/util/capture/trace_gles_loader_autogen.cpp:
* Source/ThirdParty/ANGLE/util/capture/trace_gles_loader_autogen.h:
* Source/ThirdParty/ANGLE/util/capture/trace_interpreter_autogen.cpp:
(angle::ParseCallCapture):
* Source/ThirdParty/ANGLE/util/gles_loader_autogen.cpp:
* Source/ThirdParty/ANGLE/util/gles_loader_autogen.h:
* Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.h:
* Source/WebCore/Modules/webxr/WebXROpaqueFramebufferCocoa.cpp:
(WebCore::WebXROpaqueFramebuffer::resolveMSAAFramebuffer):
(WebCore::WebXROpaqueFramebuffer::setupFramebuffer):
(WebCore::WebXROpaqueFramebuffer::bindResolveAttachments):
* Source/WebCore/platform/graphics/GraphicsContextGL.cpp:
(WebCore::GraphicsContextGL::framebufferResolveRenderbuffer):
* Source/WebCore/platform/graphics/GraphicsContextGL.h:
* Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.h:
* Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::GraphicsContextGLCocoa::framebufferResolveRenderbuffer):
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.messages.in:
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.h:
(framebufferResolveRenderbuffer):
* Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h:
* 
Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.cpp:
(WebKit::RemoteGraphicsContextGLProxy::framebufferResolveRenderbuffer):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to