Bug 212390 - [WebGPU] Update texture creation validation
Summary: [WebGPU] Update texture creation validation
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: Myles C. Maxfield
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-05-26 16:00 PDT by Myles C. Maxfield
Modified: 2020-06-01 23:07 PDT (History)
7 users (show)

See Also:


Attachments
Patch (10.11 KB, patch)
2020-05-26 16:02 PDT, Myles C. Maxfield
dino: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>