Bug 212390

Summary: [WebGPU] Update texture creation validation
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: New BugsAssignee: Myles C. Maxfield <mmaxfield>
Status: RESOLVED FIXED    
Severity: Normal CC: changseok, dino, ews-watchlist, graouts, justin_fan, kondapallykalyan, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch dino: review+

Description Myles C. Maxfield 2020-05-26 16:00:43 PDT
[WebGPU] Update texture creation validation according to the discussion at https://github.com/gpuweb/gpuweb/pull/799/files
Comment 1 Myles C. Maxfield 2020-05-26 16:02:31 PDT
Created attachment 400283 [details]
Patch
Comment 2 Justin Fan 2020-05-28 15:23:54 PDT
Comment on attachment 400283 [details]
Patch

Looks good! I don't have the power to r+, though.
Comment 3 Dean Jackson 2020-05-31 13:25:51 PDT
Comment on attachment 400283 [details]
Patch

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

> Source/WebCore/platform/graphics/gpu/GPUDevice.cpp:153
>      if (descriptor.sampleCount != 1) {
> +        if (descriptor.sampleCount != 4) {
> +            m_errorScopes->generatePrefixedError("Texture sampleCount can only be 1 or 4.");
> +            return { };
> +        }

Could you move this to an early return?

if (descriptor.sampleCount != 1 && descriptor.sampleCount != 4) {
  error and return
} 

if (descriptor.sampleCount != 1) {
  // do the stuff for 4
}
Comment 4 Myles C. Maxfield 2020-06-01 23:06:33 PDT
Committed r262407: <https://trac.webkit.org/changeset/262407>
Comment 5 Radar WebKit Bug Importer 2020-06-01 23:07:15 PDT
<rdar://problem/63860411>