[webkit-changes] [WebKit/WebKit] d38a77: [WGSL] Do not pack structs unnecessarily

Tadeu Zagallo noreply at github.com
Fri Oct 6 02:12:44 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d38a7723c351370fbfdf9a1a618c86625a64a344
      https://github.com/WebKit/WebKit/commit/d38a7723c351370fbfdf9a1a618c86625a64a344
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-10-06 (Fri, 06 Oct 2023)

  Changed paths:
    M Source/WebGPU/WGSL/GlobalVariableRewriter.cpp

  Log Message:
  -----------
  [WGSL] Do not pack structs unnecessarily
https://bugs.webkit.org/show_bug.cgi?id=262629
rdar://116468528

Reviewed by Mike Wyrzykowski.

Currently we just pack all structs that are used by global resources, which generates
unnecessarily large code and calls to pack/unpack. Instead, check if the struct actually
contains any members that needs to be packed, and skip packing if it doesn't.

* Source/WebGPU/WGSL/GlobalVariableRewriter.cpp:
(WGSL::RewriteGlobalVariables::packStructResource):
(WGSL::RewriteGlobalVariables::packType):
(WGSL::RewriteGlobalVariables::packStructType):

Canonical link: https://commits.webkit.org/268979@main




More information about the webkit-changes mailing list