[WebGPU] Use of WebGPU should not force discrete GPU
<rdar://problem/53573849>
Created attachment 376325 [details] Patch
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 on attachment 376325 [details] Patch Clearing flags on attachment: 376325 Committed r248704: <https://trac.webkit.org/changeset/248704>
All reviewed patches have been landed. Closing bug.
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.
(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.
(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.
(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.
Reopening to attach new patch.
Created attachment 376427 [details] Patch
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.
Created attachment 376428 [details] Patch
Comment on attachment 376428 [details] Patch Clearing flags on attachment: 376428 Committed r248749: <https://trac.webkit.org/changeset/248749>