[webkit-changes] [WebKit/WebKit] 7f4a94: [WebGPU] Fixup WEBGPU_IMPLEMENTATION macros

Myles C. Maxfield noreply at github.com
Tue Jan 24 12:40:03 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7f4a9441ef2fb080b9a802a7ffc822773b3f676d
      https://github.com/WebKit/WebKit/commit/7f4a9441ef2fb080b9a802a7ffc822773b3f676d
  Author: Myles C. Maxfield <mmaxfield at apple.com>
  Date:   2023-01-24 (Tue, 24 Jan 2023)

  Changed paths:
    M Source/WTF/wtf/PlatformHave.h
    M Source/WebCore/Modules/WebGPU/GPUQueue.cpp
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Document.h
    M Source/WebCore/dom/Document.idl
    M Source/WebCore/html/HTMLCanvasElement.cpp
    M Source/WebCore/html/HTMLCanvasElement.h
    M Source/WebCore/html/HTMLCanvasElement.idl
    M Source/WebCore/html/canvas/GPUCanvasContextCocoa.cpp
    M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp

  Log Message:
  -----------
  [WebGPU] Fixup WEBGPU_IMPLEMENTATION macros
https://bugs.webkit.org/show_bug.cgi?id=250967
rdar://104524084

Reviewed by Dean Jackson.

WebGPU is already behind a runtime setting. WEBGPU_IMPLEMENTATION exists not to enforce
a policy, but instead just to make code compile successfully.

All WebKit ports should be able to be hooked up to WebGPU. For Cocoa ports, they are
being hooked up to WebGPU.framework. For non-Cocoa ports, they can link with WGPU or
Dawn.

The WEBGPU_IMPLEMENTATION macro is intended to indicate whether or not a port has started
linking with one of those implementations. Almost nothing has to actually be guarded
behind it, though, since almost all of the code for WebGPU in WebCore is just platform-
independent plumbing that can be built no matter what. The only things that need to be
guarded by WEBGPU_IMPLEMENTATION are code that literally call directly into
WebGPU.framework. Most of these call sites are in WebCore/PAL/pal/graphics/WebGPU/Impl,
plus a few more around GPU creation functions.

* Source/WTF/wtf/PlatformHave.h:
* Source/WebCore/Modules/WebGPU/GPUQueue.cpp:
(WebCore::imageBufferForSource):
(WebCore::GPUQueue::copyExternalImageToTexture):
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::getCSSCanvasContext):
* Source/WebCore/dom/Document.h:
* Source/WebCore/dom/Document.idl:
* Source/WebCore/html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
* Source/WebCore/html/HTMLCanvasElement.h:
* Source/WebCore/html/HTMLCanvasElement.idl:

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




More information about the webkit-changes mailing list