[webkit-changes] [WebKit/WebKit] d0dec9: [WebGPU] Add native app for playing around with We...

Myles C. Maxfield noreply at github.com
Tue Jan 17 11:59:50 PST 2023


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

  Changed paths:
    R Source/WebGPU/CommandLinePlayground/main.swift
    R Source/WebGPU/Configurations/CommandLinePlayground.xcconfig
    M Source/WebGPU/Configurations/WebGPU.xcconfig
    M Source/WebGPU/WebGPU.xcodeproj/project.pbxproj
    A Tools/WebGPUPlayground/AppPlayground/AppPlayground-Bridging-Header.h
    A Tools/WebGPUPlayground/AppPlayground/AppPlayground.entitlements
    A Tools/WebGPUPlayground/AppPlayground/AppPlaygroundApp.swift
    A Tools/WebGPUPlayground/AppPlayground/Assets.xcassets/AccentColor.colorset/Contents.json
    A Tools/WebGPUPlayground/AppPlayground/Assets.xcassets/AppIcon.appiconset/Contents.json
    A Tools/WebGPUPlayground/AppPlayground/Assets.xcassets/Contents.json
    A Tools/WebGPUPlayground/AppPlayground/ContentView.swift
    A Tools/WebGPUPlayground/AppPlayground/Preview Content/Preview Assets.xcassets/Contents.json
    A Tools/WebGPUPlayground/AppPlayground/WebGPUCoordinator.h
    A Tools/WebGPUPlayground/AppPlayground/WebGPUCoordinator.m
    A Tools/WebGPUPlayground/AppPlayground/WebGPUView+AppKit.swift
    A Tools/WebGPUPlayground/AppPlayground/WebGPUView+UIKit.swift
    A Tools/WebGPUPlayground/AppPlayground/config.h
    A Tools/WebGPUPlayground/CommandLinePlayground/main.c
    A Tools/WebGPUPlayground/Configurations/AppPlayground.xcconfig
    A Tools/WebGPUPlayground/Configurations/Base.xcconfig
    A Tools/WebGPUPlayground/Configurations/CommandLinePlayground.xcconfig
    A Tools/WebGPUPlayground/Configurations/DebugRelease.xcconfig
    A Tools/WebGPUPlayground/WebGPUPlayground.xcodeproj/project.pbxproj

  Log Message:
  -----------
  [WebGPU] Add native app for playing around with WebGPU
https://bugs.webkit.org/show_bug.cgi?id=250626
rdar://104265536

Reviewed by Tadeu Zagallo.

This patch creates a native multiplatform app (that has a GUI) that is hooked up to
WebGPU. The GUI is important so you can see the results of your drawing commands.
The app itself is implemented using SwiftUI and MetalKit, so it can be multiplatform
(both macOS and iOS). The reason to create this native app is mainly to ease build
times, so that it's possible to develop WebGPU without building all of WebKit, and because
it will be faster it iterate on because its compositing architecture is way simpler
than WebKit's.

There was already a command-line playground in WebGPU.xcodeproj; this patch moves it
to be alongside the new app playground inside Tools/.

WebGPU doesn't actually work with this native app out-of-the-box just yet; it needs
https://github.com/WebKit/WebKit/pull/8665.

* Source/WebGPU/CommandLinePlayground/main.swift: Removed.
* Source/WebGPU/Configurations/WebGPU.xcconfig:
* Source/WebGPU/WebGPU.xcodeproj/project.pbxproj:
* Tools/WebGPUPlayground/AppPlayground/AppPlayground-Bridging-Header.h: Added.
* Tools/WebGPUPlayground/AppPlayground/AppPlayground.entitlements: Added.
* Tools/WebGPUPlayground/AppPlayground/AppPlaygroundApp.swift: Added.
(AppPlaygroundApp.body):
* Tools/WebGPUPlayground/AppPlayground/Assets.xcassets/AccentColor.colorset/Contents.json: Added.
* Tools/WebGPUPlayground/AppPlayground/Assets.xcassets/AppIcon.appiconset/Contents.json: Added.
* Tools/WebGPUPlayground/AppPlayground/Assets.xcassets/Contents.json: Added.
* Tools/WebGPUPlayground/AppPlayground/ContentView.swift: Added.
(ContentView.body):
(ContentView_Previews.previews):
* Tools/WebGPUPlayground/AppPlayground/Preview Content/Preview Assets.xcassets/Contents.json: Added.
* Tools/WebGPUPlayground/AppPlayground/WebGPUCoordinator.h: Added.
* Tools/WebGPUPlayground/AppPlayground/WebGPUCoordinator.m: Added.
(-[Scheduler init]):
(-[Scheduler schedule:]):
(-[WebGPUCoordinator init]):
(-[WebGPUCoordinator dealloc]):
(-[WebGPUCoordinator setView:]):
(-[WebGPUCoordinator drawInMTKView:]):
(-[WebGPUCoordinator mtkView:drawableSizeWillChange:]):
* Tools/WebGPUPlayground/AppPlayground/WebGPUView+AppKit.swift: Added.
(WebGPUView.makeNSView(_:)):
(WebGPUView.updateNSView(_:context:)):
(WebGPUView.makeCoordinator):
* Tools/WebGPUPlayground/AppPlayground/WebGPUView+UIKit.swift: Added.
(WebGPUView.makeUIView(_:)):
(WebGPUView.updateUIView(_:context:)):
(WebGPUView.makeCoordinator):
* Tools/WebGPUPlayground/AppPlayground/config.h: Added.
* Tools/WebGPUPlayground/CommandLinePlayground/main.c: Added.
(main):
* Tools/WebGPUPlayground/Configurations/AppPlayground.xcconfig: Copied from Source/WebGPU/Configurations/CommandLinePlayground.xcconfig.
* Tools/WebGPUPlayground/Configurations/Base.xcconfig: Added.
* Tools/WebGPUPlayground/Configurations/CommandLinePlayground.xcconfig: Copied from Source/WebGPU/Configurations/CommandLinePlayground.xcconfig.
* Tools/WebGPUPlayground/Configurations/DebugRelease.xcconfig: Renamed from Source/WebGPU/Configurations/CommandLinePlayground.xcconfig.
* Tools/WebGPUPlayground/WebGPUPlayground.xcodeproj/project.pbxproj: Added.

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




More information about the webkit-changes mailing list