[webkit-changes] [WebKit/WebKit] ac4a3a: [WGSL] Support for atomic functions

Tadeu Zagallo noreply at github.com
Wed Oct 4 01:19:52 PDT 2023


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

  Changed paths:
    M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
    M Source/WebGPU/WGSL/Overload.cpp
    M Source/WebGPU/WGSL/Overload.h
    M Source/WebGPU/WGSL/TypeDeclarations.rb
    M Source/WebGPU/WGSL/generator/main.rb
    M Source/WebGPU/WGSL/tests/valid/overload.wgsl

  Log Message:
  -----------
  [WGSL] Support for atomic functions
https://bugs.webkit.org/show_bug.cgi?id=262350
rdar://116211761

Reviewed by Mike Wyrzykowski.

Add support for all atomic functions from the spec[1], except for `atomicCompareExchangeWeak`
since we don't yet support the custom return structs.

[1]: https://www.w3.org/TR/WGSL/#atomic-builtin-functions

* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::atomicFunction):
(WGSL::Metal::emitAtomicLoad):
(WGSL::Metal::emitAtomicStore):
(WGSL::Metal::emitAtomicAdd):
(WGSL::Metal::emitAtomicSub):
(WGSL::Metal::emitAtomicMax):
(WGSL::Metal::emitAtomicMin):
(WGSL::Metal::emitAtomicOr):
(WGSL::Metal::emitAtomicXor):
(WGSL::Metal::emitAtomicExchange):
(WGSL::Metal::FunctionDefinitionWriter::visit):
* Source/WebGPU/WGSL/Overload.cpp:
(WGSL::OverloadResolver::materialize const):
(WGSL::OverloadResolver::calculateRank):
(WGSL::OverloadResolver::unify):
(WTF::printInternal):
* Source/WebGPU/WGSL/Overload.h:
* Source/WebGPU/WGSL/TypeDeclarations.rb:
* Source/WebGPU/WGSL/generator/main.rb:
* Source/WebGPU/WGSL/tests/valid/overload.wgsl:

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




More information about the webkit-changes mailing list