[webkit-changes] [WebKit/WebKit] 6bee91: [WGSL] Implement bitcast

Tadeu Zagallo noreply at github.com
Fri Oct 20 13:45:20 PDT 2023


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

  Changed paths:
    M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
    M Source/WebGPU/WGSL/TypeCheck.cpp
    M Source/WebGPU/WGSL/TypeDeclarations.rb
    A Source/WebGPU/WGSL/tests/invalid/bitcast.wgsl
    M Source/WebGPU/WGSL/tests/valid/overload.wgsl

  Log Message:
  -----------
  [WGSL] Implement bitcast
https://bugs.webkit.org/show_bug.cgi?id=263398
rdar://117222621

Reviewed by Dan Glastonbury.

Implement bitcast according to the spec[1]. Unfortunately, as mentioned in the comment
I added in TypeDeclarations.rb, our constraint system isn't flexible enough to express
all the bitcast overloads, so the checking is done manually in the type checker.

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

* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::emitBitcast):
(WGSL::Metal::FunctionDefinitionWriter::visit):
* Source/WebGPU/WGSL/TypeCheck.cpp:
(WGSL::TypeChecker::visit):
(WGSL::TypeChecker::bitcast):
* Source/WebGPU/WGSL/TypeDeclarations.rb:
* Source/WebGPU/WGSL/tests/invalid/bitcast.wgsl: Added.
* Source/WebGPU/WGSL/tests/valid/overload.wgsl:

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




More information about the webkit-changes mailing list