[webkit-changes] [WebKit/WebKit] 5b1b2f: [WGSL] Unary expression serialization breaks prece...

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


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5b1b2fbebfb0ab22215a0b9dfdf4a41ca10ca827
      https://github.com/WebKit/WebKit/commit/5b1b2fbebfb0ab22215a0b9dfdf4a41ca10ca827
  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/tests/valid/packing.wgsl
    M Source/WebGPU/WGSL/tests/valid/pointers.wgsl

  Log Message:
  -----------
  [WGSL] Unary expression serialization breaks precedence
https://bugs.webkit.org/show_bug.cgi?id=263394
rdar://117221664

Reviewed by Dan Glastonbury.

When serializing unary expressions, we need to add parentheses around the result,
as otherwise the precedence of the result might be wrong. This is easily noticeable
with pointers, as `(*p).x` from WGSL was being serialized as `*p.x` in MSL.

* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::visit):
* Source/WebGPU/WGSL/tests/valid/packing.wgsl:
* Source/WebGPU/WGSL/tests/valid/pointers.wgsl:

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




More information about the webkit-changes mailing list