Bug 195427 - [Web GPU] GPUSampler implementation
Summary: [Web GPU] GPUSampler implementation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P1 Normal
Assignee: Justin Fan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-03-07 12:17 PST by Justin Fan
Modified: 2019-03-07 15:04 PST (History)
4 users (show)

See Also:


Attachments
Patch (65.76 KB, patch)
2019-03-07 12:47 PST, Justin Fan
no flags Details | Formatted Diff | Diff
Patch (65.83 KB, patch)
2019-03-07 12:56 PST, Justin Fan
no flags Details | Formatted Diff | Diff
Patch (67.07 KB, patch)
2019-03-07 13:15 PST, Justin Fan
no flags Details | Formatted Diff | Diff
Patch for landing (67.63 KB, patch)
2019-03-07 14:30 PST, 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-03-07 12:17:16 PST
[Web GPU] GPUSampler implementation
Comment 1 Radar WebKit Bug Importer 2019-03-07 12:38:40 PST
<rdar://problem/48686011>
Comment 2 Justin Fan 2019-03-07 12:47:09 PST
Created attachment 363910 [details]
Patch
Comment 3 EWS Watchlist 2019-03-07 12:50:31 PST
Attachment 363910 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.h:64:  The parameter name "const" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.h:65:  The parameter name "const" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.h:66:  The parameter name "const" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 3 in 34 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Justin Fan 2019-03-07 12:56:36 PST
Created attachment 363913 [details]
Patch
Comment 5 EWS Watchlist 2019-03-07 13:00:06 PST
Attachment 363913 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.h:64:  The parameter name "const" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.h:65:  The parameter name "const" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.h:66:  The parameter name "const" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 3 in 34 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Justin Fan 2019-03-07 13:15:05 PST
Created attachment 363916 [details]
Patch
Comment 7 EWS Watchlist 2019-03-07 13:18:23 PST
Attachment 363916 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.h:64:  The parameter name "const" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.h:65:  The parameter name "const" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.h:66:  The parameter name "const" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 3 in 35 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Dean Jackson 2019-03-07 13:57:04 PST
Comment on attachment 363916 [details]
Patch

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

> Source/WebCore/platform/graphics/gpu/GPUSamplerDescriptor.h:63
> +    AddressMode addressModeU = AddressMode::ClampToEdge;
> +    AddressMode addressModeV = AddressMode::ClampToEdge;
> +    AddressMode addressModeW = AddressMode::ClampToEdge;
> +    FilterMode magFilter = FilterMode::Nearest;
> +    FilterMode minFilter = FilterMode::Nearest;
> +    FilterMode mipmapFilter = FilterMode::Nearest;
> +    float lodMinClamp = 0;
> +    float lodMaxClamp = 0xffffffff;
> +    unsigned maxAnisotropy = 1;
> +    GPUCompareFunction compareFunction = GPUCompareFunction::Never;
> +    BorderColor borderColor = BorderColor::TransparentBlack;

Is there any difference between this syntax and using AddressMode addressModeU { AddressMode::ClampToEdge }; ?
Comment 9 Justin Fan 2019-03-07 14:21:23 PST
(In reply to Dean Jackson from comment #8)
> Comment on attachment 363916 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=363916&action=review
> 
> > Source/WebCore/platform/graphics/gpu/GPUSamplerDescriptor.h:63
> > +    AddressMode addressModeU = AddressMode::ClampToEdge;
> > +    AddressMode addressModeV = AddressMode::ClampToEdge;
> > +    AddressMode addressModeW = AddressMode::ClampToEdge;
> > +    FilterMode magFilter = FilterMode::Nearest;
> > +    FilterMode minFilter = FilterMode::Nearest;
> > +    FilterMode mipmapFilter = FilterMode::Nearest;
> > +    float lodMinClamp = 0;
> > +    float lodMaxClamp = 0xffffffff;
> > +    unsigned maxAnisotropy = 1;
> > +    GPUCompareFunction compareFunction = GPUCompareFunction::Never;
> > +    BorderColor borderColor = BorderColor::TransparentBlack;
> 
> Is there any difference between this syntax and using AddressMode
> addressModeU { AddressMode::ClampToEdge }; ?

In this case there is no difference. I guess in the case of default initialization, brace initialization is a little less error-prone, but it's a style choice.
Comment 10 Justin Fan 2019-03-07 14:30:09 PST
Created attachment 363928 [details]
Patch for landing
Comment 11 WebKit Commit Bot 2019-03-07 15:03:08 PST
The commit-queue encountered the following flaky tests while processing attachment 363928 [details]:

loader/load-defer-resume-crash.html bug 195438 (authors: max.hong.shen@gmail.com and rniwa@webkit.org)
The commit-queue is continuing to process your patch.
Comment 12 WebKit Commit Bot 2019-03-07 15:03:59 PST
Comment on attachment 363928 [details]
Patch for landing

Clearing flags on attachment: 363928

Committed r242615: <https://trac.webkit.org/changeset/242615>
Comment 13 WebKit Commit Bot 2019-03-07 15:04:01 PST
All reviewed patches have been landed.  Closing bug.