Bug 217725

Summary: [WebGPU] Centralize Platform Defines
Product: WebKit Reporter: Don Olmstead <don.olmstead>
Component: WebGPUAssignee: Don Olmstead <don.olmstead>
Status: RESOLVED FIXED    
Severity: Normal CC: changseok, dino, ews-watchlist, graouts, kondapallykalyan, mmaxfield, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
WIP Patch
ews-feeder: commit-queue-
WIP Patch
none
WIP Patch
ews-feeder: commit-queue-
WIP Patch
none
Patch
mmaxfield: review+
Check build
none
Check build
none
Patch none

Description Don Olmstead 2020-10-14 12:37:58 PDT
On platforms supporting Metal each Platform* definition points to an ObjC construct which is wrapped in a RetainPtr. For Dawn clients more code is required for smart pointers to function properly.

Idea is to include a GPUPlatformTypes.h with all the Platform* and Platform*SmartPtr definitions. Then when Dawn is added it'll just have that file to include which will contain its definitions.
Comment 1 Don Olmstead 2020-10-15 07:29:15 PDT Comment hidden (obsolete)
Comment 2 Don Olmstead 2020-10-15 07:38:01 PDT Comment hidden (obsolete)
Comment 3 Don Olmstead 2020-10-15 10:39:36 PDT Comment hidden (obsolete)
Comment 4 Don Olmstead 2020-10-15 10:46:00 PDT Comment hidden (obsolete)
Comment 5 Don Olmstead 2020-10-15 12:40:56 PDT
Created attachment 411473 [details]
Patch
Comment 6 Myles C. Maxfield 2020-10-15 17:06:32 PDT
Comment on attachment 411473 [details]
Patch

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

Good cleanup.

> Source/WebCore/platform/graphics/gpu/cocoa/GPUPlatformTypes.h:1
> +/*

IIRC it's impossible (or maybe just error-prone?) to have two files with the same name in different directories. If that's true, then this will have to be moved out of cocoa/ and have PLATFORM guards inside the file.
Comment 7 Myles C. Maxfield 2020-10-15 17:14:48 PDT
Comment on attachment 411473 [details]
Patch

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

>> Source/WebCore/platform/graphics/gpu/cocoa/GPUPlatformTypes.h:1
>> +/*
> 
> IIRC it's impossible (or maybe just error-prone?) to have two files with the same name in different directories. If that's true, then this will have to be moved out of cocoa/ and have PLATFORM guards inside the file.

Oh, PLATFORM isn't right. It should be the same check that is used in the rest of the code.
Comment 8 Don Olmstead 2020-10-16 08:14:14 PDT Comment hidden (obsolete)
Comment 9 Don Olmstead 2020-10-16 08:18:54 PDT Comment hidden (obsolete)
Comment 10 Don Olmstead 2020-10-16 11:31:27 PDT
Created attachment 411600 [details]
Patch
Comment 11 EWS 2020-10-16 12:32:44 PDT
Committed r268603: <https://trac.webkit.org/changeset/268603>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 411600 [details].
Comment 12 Radar WebKit Bug Importer 2020-10-16 12:33:18 PDT
<rdar://problem/70387909>