[webkit-changes] [WebKit/WebKit] 2fc4c7: [WGSL] Move constraints code to its own file

Tadeu Zagallo noreply at github.com
Fri Apr 21 05:43:28 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2fc4c77726be4596356d9827641a6458a913a31d
      https://github.com/WebKit/WebKit/commit/2fc4c77726be4596356d9827641a6458a913a31d
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-04-21 (Fri, 21 Apr 2023)

  Changed paths:
    A Source/WebGPU/WGSL/Constraints.cpp
    A Source/WebGPU/WGSL/Constraints.h
    M Source/WebGPU/WGSL/Overload.cpp
    M Source/WebGPU/WGSL/Overload.h
    M Source/WebGPU/WGSL/generator/main.rb
    M Source/WebGPU/WebGPU.xcodeproj/project.pbxproj

  Log Message:
  -----------
  [WGSL] Move constraints code to its own file
https://bugs.webkit.org/show_bug.cgi?id=255724
rdar://108317489

Reviewed by Mike Wyrzykowski.

The constraints-related helper functions also need to be used by other passes, so
I extracted it from Overload.h/cpp into its own file. When moving it, I converted
the enum to enum class, since it used to be nested in the TypeVariable class and
now it became a top-level declaration. Unfortunately, this breaks all the bitwise
operations, so I refactored it to use OptionSet instead of working with the enum
members directly.

* Source/WTF/wtf/OptionSet.h:
(WTF::OptionSet::OptionSet):
* Source/WebGPU/WGSL/Constraints.cpp: Added.
(WGSL::satisfies):
(WGSL::satisfyOrPromote):
* Source/WebGPU/WGSL/Constraints.h: Added.
* Source/WebGPU/WGSL/Overload.cpp:
(WGSL::OverloadResolver::assign):
* Source/WebGPU/WGSL/Overload.h:
* Source/WebGPU/WGSL/generator/main.rb:
* Source/WebGPU/WebGPU.xcodeproj/project.pbxproj:

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




More information about the webkit-changes mailing list