Bug 200740 - [WebGPU] Use of WebGPU should not force discrete GPU
Summary: [WebGPU] Use of WebGPU should not force discrete GPU
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:
 
Reported: 2019-08-14 15:57 PDT by Justin Fan
Modified: 2019-08-15 15:15 PDT (History)
8 users (show)

See Also:


Attachments
Patch (2.29 KB, patch)
2019-08-14 16:01 PDT, Justin Fan
no flags Details | Formatted Diff | Diff
Patch (1.30 KB, patch)
2019-08-15 15:05 PDT, Justin Fan
no flags Details | Formatted Diff | Diff
Patch (1.21 KB, patch)
2019-08-15 15:10 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 2019-08-14 15:57:45 PDT
[WebGPU] Use of WebGPU should not force discrete GPU
Comment 1 Justin Fan 2019-08-14 15:58:23 PDT
<rdar://problem/53573849>
Comment 2 Justin Fan 2019-08-14 16:01:47 PDT
Created attachment 376325 [details]
Patch
Comment 3 Myles C. Maxfield 2019-08-14 16:15:59 PDT
Comment on attachment 376325 [details]
Patch

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

> Source/WebCore/platform/graphics/gpu/GPURequestAdapterOptions.h:40
> +    Optional<GPUPowerPreference> powerPreference { GPUPowerPreference::LowPower };

Why is this optional any more, then?
Comment 4 WebKit Commit Bot 2019-08-14 19:34:31 PDT
Comment on attachment 376325 [details]
Patch

Clearing flags on attachment: 376325

Committed r248704: <https://trac.webkit.org/changeset/248704>
Comment 5 WebKit Commit Bot 2019-08-14 19:34:32 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Darin Adler 2019-08-15 08:32:51 PDT
Comment on attachment 376325 [details]
Patch

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

>> Source/WebCore/platform/graphics/gpu/GPURequestAdapterOptions.h:40
>> +    Optional<GPUPowerPreference> powerPreference { GPUPowerPreference::LowPower };
> 
> Why is this optional any more, then?

I’d like to understand this too.
Comment 7 Justin Fan 2019-08-15 12:46:39 PDT
(In reply to Darin Adler from comment #6)
> Comment on attachment 376325 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=376325&action=review
> 
> >> Source/WebCore/platform/graphics/gpu/GPURequestAdapterOptions.h:40
> >> +    Optional<GPUPowerPreference> powerPreference { GPUPowerPreference::LowPower };
> > 
> > Why is this optional any more, then?
> 
> I’d like to understand this too.

Hi! I noted this only offline to Myles, but the current spec still calls for a ‘?’ in that field and not wrapping the member in Optional results in binding compile error. Us providing the default is an impl detail.
Comment 8 Darin Adler 2019-08-15 14:49:50 PDT
(In reply to Justin Fan from comment #7)
> the current spec still calls for
> a ‘?’ in that field and not wrapping the member in Optional results in
> binding compile error. Us providing the default is an impl detail.

I don’t think this is the right idiom for an optional value with default behavior. We should remove the default value from the struct and have the code that gets the value from the struct apply the default using valueOr.
Comment 9 Justin Fan 2019-08-15 14:53:00 PDT
(In reply to Darin Adler from comment #8)
> (In reply to Justin Fan from comment #7)
> > the current spec still calls for
> > a ‘?’ in that field and not wrapping the member in Optional results in
> > binding compile error. Us providing the default is an impl detail.
> 
> I don’t think this is the right idiom for an optional value with default
> behavior. We should remove the default value from the struct and have the
> code that gets the value from the struct apply the default using valueOr.

Cool, did not know valueOr was a thing. Will update.
Comment 10 Justin Fan 2019-08-15 15:05:41 PDT
Reopening to attach new patch.
Comment 11 Justin Fan 2019-08-15 15:05:42 PDT
Created attachment 376427 [details]
Patch
Comment 12 EWS Watchlist 2019-08-15 15:07:34 PDT
Attachment 376427 [details] did not pass style-queue:


ERROR: Source/WebCore/ChangeLog:8:  You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 13 Justin Fan 2019-08-15 15:10:40 PDT
Created attachment 376428 [details]
Patch
Comment 14 Justin Fan 2019-08-15 15:15:32 PDT
Comment on attachment 376428 [details]
Patch

Clearing flags on attachment: 376428

Committed r248749: <https://trac.webkit.org/changeset/248749>
Comment 15 Justin Fan 2019-08-15 15:15:34 PDT
All reviewed patches have been landed.  Closing bug.