[webkit-changes] [WebKit/WebKit] 4dc734: [WGSL] Fix type promotion in assignments

Tadeu Zagallo noreply at github.com
Mon Sep 25 17:21:40 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4dc734cd04a3c28ce46b2162cf0e5b3223dac59c
      https://github.com/WebKit/WebKit/commit/4dc734cd04a3c28ce46b2162cf0e5b3223dac59c
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-09-25 (Mon, 25 Sep 2023)

  Changed paths:
    M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
    M Source/WebGPU/WGSL/tests/valid/type-promotion.wgsl

  Log Message:
  -----------
  [WGSL] Fix type promotion in assignments
https://bugs.webkit.org/show_bug.cgi?id=262041
rdar://115993415

Reviewed by Dan Glastonbury.

Similar to how we fixed variable intialization, when generating code for assignments
we also need to pass down the expected type by right-hand side expression. This allows
concretizing expressions to a different type: e.g. a vector of abstract integers would
normally be concretized into a vector of integers, but can instead become a vector
of floats if that is what the left-hand side expects.

* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::visit):
* Source/WebGPU/WGSL/tests/valid/type-promotion.wgsl:

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




More information about the webkit-changes mailing list