[webkit-reviews] review granted: [Bug 212390] [WebGPU] Update texture creation validation : [Attachment 400283] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun May 31 13:25:51 PDT 2020


Dean Jackson <dino at apple.com> has granted Myles C. Maxfield
<mmaxfield at apple.com>'s request for review:
Bug 212390: [WebGPU] Update texture creation validation
https://bugs.webkit.org/show_bug.cgi?id=212390

Attachment 400283: Patch

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




--- Comment #3 from Dean Jackson <dino at apple.com> ---
Comment on attachment 400283
  --> https://bugs.webkit.org/attachment.cgi?id=400283
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
}


More information about the webkit-reviews mailing list