[webkit-changes] [WebKit/WebKit] e87150: [WGSL] Always initialize serialized variables

Tadeu Zagallo noreply at github.com
Wed Oct 4 01:39:58 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e8715062927169f213d7af04dfb19af987e9cf57
      https://github.com/WebKit/WebKit/commit/e8715062927169f213d7af04dfb19af987e9cf57
  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/tests/lit.cfg
    M Source/WebGPU/WGSL/tests/valid/global-used-by-callee.wgsl

  Log Message:
  -----------
  [WGSL] Always initialize serialized variables
https://bugs.webkit.org/show_bug.cgi?id=262545
rdar://116402632

Reviewed by Mike Wyrzykowski.

When a variable declaration had no user-defined initialization, we just emitted
an unitialized variable, but that is not correct since WGSL has default initial
values[1]. For now, we just emit curly braces with the C++ default initialization,
which seems to match the zero values in WGSL.

[1]: https://www.w3.org/TR/WGSL/#default-initial-value

* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::serializeVariable):
* Source/WebGPU/WGSL/tests/valid/global-used-by-callee.wgsl:

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




More information about the webkit-changes mailing list