[webkit-changes] [WebKit/WebKit] 7a0271: [WGSL] Fix compound assignment for matrix

Tadeu Zagallo noreply at github.com
Mon Nov 13 09:55:31 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7a0271a0a95d61258733c44320a1163335b9dd45
      https://github.com/WebKit/WebKit/commit/7a0271a0a95d61258733c44320a1163335b9dd45
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-11-13 (Mon, 13 Nov 2023)

  Changed paths:
    M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
    M Source/WebGPU/WGSL/tests/valid/overload.wgsl

  Log Message:
  -----------
  [WGSL] Fix compound assignment for matrix
https://bugs.webkit.org/show_bug.cgi?id=264606
rdar://118240280

Reviewed by Mike Wyrzykowski.

MSL doesn't like compound multiplication of matrices. So instead we simplify the
code and merge the implementation of CompoundAssignment and BinaryExpression by
serializing all CompoundAssignments as regular assignments plus a binary expression.
e.g. `a *= b` becomes `a = a * b`

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

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




More information about the webkit-changes mailing list