Bug 190325 - WebGPU: Rename old WebGPU prototype to WebMetal
Summary: WebGPU: Rename old WebGPU prototype to WebMetal
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Justin Fan
URL:
Keywords: InRadar
Depends on:
Blocks: 190403
  Show dependency treegraph
 
Reported: 2018-10-05 19:02 PDT by Justin Fan
Modified: 2018-10-09 10:30 PDT (History)
23 users (show)

See Also:


Attachments
Patch (1.04 MB, patch)
2018-10-05 19:28 PDT, Justin Fan
no flags Details | Formatted Diff | Diff
Patch (1.04 MB, patch)
2018-10-05 20:10 PDT, Justin Fan
no flags Details | Formatted Diff | Diff
Patch (1.03 MB, patch)
2018-10-08 15:31 PDT, Justin Fan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Fan 2018-10-05 19:02:10 PDT
WebGPU: Rename old WebGPU prototype to WebMetal
Comment 1 Justin Fan 2018-10-05 19:02:31 PDT
<rdar://problem/44990443>
Comment 2 Justin Fan 2018-10-05 19:28:09 PDT
Created attachment 351710 [details]
Patch
Comment 3 EWS Watchlist 2018-10-05 19:34:43 PDT
This patch modifies the inspector protocol generator. Please ensure that you have rebaselined any generator test results (i.e., by running `Tools/Scripts/run-inspector-generator-tests --reset-results`)
Comment 4 EWS Watchlist 2018-10-05 19:35:12 PDT
Attachment 351710 [details] did not pass style-queue:


ERROR: Source/WebCore/html/canvas/WebMetalDrawable.cpp:43:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebCore/html/canvas/WebMetalLibrary.cpp:42:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebCore/html/canvas/WebMetalCommandBuffer.cpp:49:  This { should be at the end of the previous line  [whitespace/braces] [4]
Total errors found: 3 in 217 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Justin Fan 2018-10-05 20:10:31 PDT
Created attachment 351712 [details]
Patch
Comment 6 EWS Watchlist 2018-10-05 20:15:20 PDT
Attachment 351712 [details] did not pass style-queue:


ERROR: Source/WebCore/html/canvas/WebMetalDrawable.cpp:43:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebCore/html/canvas/WebMetalLibrary.cpp:42:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebCore/html/canvas/WebMetalCommandBuffer.cpp:49:  This { should be at the end of the previous line  [whitespace/braces] [4]
Total errors found: 3 in 219 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Devin Rousso 2018-10-06 12:43:55 PDT
Comment on attachment 351712 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=351712&action=review

> Source/WebInspectorUI/UserInterface/Models/Canvas.js:-71
> -        case CanvasAgent.ContextType.WebGPU:

Ditto (308).

> Source/WebInspectorUI/UserInterface/Models/Canvas.js:-98
> -        case WI.Canvas.ContextType.WebGPU:

Ditto (308).

> Source/WebInspectorUI/UserInterface/Models/Canvas.js:-308
> -    WebGPU: "webgpu",

Given what I wrote below (InspectorBackendCommands.js:70), this will need to stay as is for iOS 11.3 and 12.0.  You can add `WebMetal` to it, but you need to keep `WebGPU`.

> Source/WebInspectorUI/UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js:-70
> -InspectorBackend.registerEnum("Canvas.ContextType", {Canvas2D: "canvas-2d", BitmapRenderer: "bitmaprenderer", WebGL: "webgl", WebGL2: "webgl2", WebGPU: "webgpu"});

We don't want to modify this file.  It is used by newer frontends to know what commands are available on older backends (e.g. macOS 10.14 connecting to a iOS 11.3 device).  This file is effectively "frozen in time" based on what the iOS version supported at the time it was created.

> Source/WebInspectorUI/UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js:-70
> -InspectorBackend.registerEnum("Canvas.ContextType", {Canvas2D: "canvas-2d", BitmapRenderer: "bitmaprenderer", WebGL: "webgl", WebGL2: "webgl2", WebGPU: "webgpu"});

Ditto.
Comment 8 Justin Fan 2018-10-08 12:54:04 PDT
Got it, thanks for the review.
Comment 9 Dean Jackson 2018-10-08 13:24:15 PDT
Comment on attachment 351712 [details]
Patch

We need to put something at Websites/webkit.org/demos/webgpu/index.html to point at the WebMetal demos.
Comment 10 Joseph Pecoraro 2018-10-08 13:39:26 PDT
Comment on attachment 351712 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=351712&action=review

>> Source/WebInspectorUI/UserInterface/Models/Canvas.js:-308
>> -    WebGPU: "webgpu",
> 
> Given what I wrote below (InspectorBackendCommands.js:70), this will need to stay as is for iOS 11.3 and 12.0.  You can add `WebMetal` to it, but you need to keep `WebGPU`.

To expand on Devin's point you will need to keep the WebGPU enum value too upport legacy backends. In all cases you can make it do the same thing as the new WebMetal enum you're introducing.

>> Source/WebInspectorUI/UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js:-70
>> -InspectorBackend.registerEnum("Canvas.ContextType", {Canvas2D: "canvas-2d", BitmapRenderer: "bitmaprenderer", WebGL: "webgl", WebGL2: "webgl2", WebGPU: "webgpu"});
> 
> We don't want to modify this file.  It is used by newer frontends to know what commands are available on older backends (e.g. macOS 10.14 connecting to a iOS 11.3 device).  This file is effectively "frozen in time" based on what the iOS version supported at the time it was created.

Correct. Great catch Devin! These files are generated from Source/WebInspectorUI/Versions (as is written at the top of the file). These shouldn't be changing with this patch.
Comment 11 Justin Fan 2018-10-08 15:31:50 PDT
Created attachment 351824 [details]
Patch
Comment 12 EWS Watchlist 2018-10-08 15:39:27 PDT
Attachment 351824 [details] did not pass style-queue:


ERROR: Source/WebCore/html/canvas/WebMetalDrawable.cpp:43:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebCore/html/canvas/WebMetalLibrary.cpp:42:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebCore/html/canvas/WebMetalCommandBuffer.cpp:49:  This { should be at the end of the previous line  [whitespace/braces] [4]
Total errors found: 3 in 219 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 13 WebKit Commit Bot 2018-10-08 18:37:46 PDT
Comment on attachment 351824 [details]
Patch

Clearing flags on attachment: 351824

Committed r236954: <https://trac.webkit.org/changeset/236954>
Comment 14 WebKit Commit Bot 2018-10-08 18:37:48 PDT
All reviewed patches have been landed.  Closing bug.