WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
238250
[WebGPU] Clean up implementation of Device::createSampler()
https://bugs.webkit.org/show_bug.cgi?id=238250
Summary
[WebGPU] Clean up implementation of Device::createSampler()
Myles C. Maxfield
Reported
2022-03-23 03:46:16 PDT
[WebGPU] Clean up implementation of Device::createSampler()
Attachments
Patch
(9.17 KB, patch)
2022-03-23 03:46 PDT
,
Myles C. Maxfield
darin
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Myles C. Maxfield
Comment 1
2022-03-23 03:46:52 PDT
Created
attachment 455483
[details]
Patch
Darin Adler
Comment 2
2022-03-23 09:04:40 PDT
Comment on
attachment 455483
[details]
Patch Love these conversion helper functions. Names can be really short since they do such a straightforward mapping. Not so thrilled by all the use of default here. Typically we like to use enums and switches without default cases so we can get warnings when new values are introduced.
Myles C. Maxfield
Comment 3
2022-03-23 11:48:12 PDT
(In reply to Darin Adler from
comment #2
)
> Comment on
attachment 455483
[details]
> Patch > > Love these conversion helper functions. Names can be really short since they > do such a straightforward mapping. Not so thrilled by all the use of default > here. Typically we like to use enums and switches without default cases so > we can get warnings when new values are introduced.
Right. The reason I made the defaults originally is because the enum values have values like `WGPUFilterMode_Force32 = 0x7FFFFFFF` (because they come from a C header which doesn't have enum classes). I think you're right, though, that it's better to list these Force32 values explicitly, because doing so would automatically indicate many of the places which would need to be updated when adding new enum values in the future. I'll also make a follow-up patch to try to get rid of as many default:s as possible throughout the entire framework.
Myles C. Maxfield
Comment 4
2022-03-23 11:58:36 PDT
Committed
r291758
(?): <
https://commits.webkit.org/r291758
>
Radar WebKit Bug Importer
Comment 5
2022-03-23 11:59:11 PDT
<
rdar://problem/90714790
>
Myles C. Maxfield
Comment 6
2022-03-23 19:54:52 PDT
(In reply to Myles C. Maxfield from
comment #3
)
> (In reply to Darin Adler from
comment #2
) > > Comment on
attachment 455483
[details]
> > Patch > > > > Love these conversion helper functions. Names can be really short since they > > do such a straightforward mapping. Not so thrilled by all the use of default > > here. Typically we like to use enums and switches without default cases so > > we can get warnings when new values are introduced. > > Right. The reason I made the defaults originally is because the enum values > have values like `WGPUFilterMode_Force32 = 0x7FFFFFFF` (because they come > from a C header which doesn't have enum classes). I think you're right, > though, that it's better to list these Force32 values explicitly, because > doing so would automatically indicate many of the places which would need to > be updated when adding new enum values in the future. > > I'll also make a follow-up patch to try to get rid of as many default:s as > possible throughout the entire framework.
https://bugs.webkit.org/show_bug.cgi?id=238305
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug