[webkit-changes] [WebKit/WebKit] bce46d: [WGSL] Use array<T, 1> syntax to serialize runtime...

Tadeu Zagallo noreply at github.com
Thu Jun 15 01:42:05 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bce46d260f1dd126c442ff06bcaf493d067a4116
      https://github.com/WebKit/WebKit/commit/bce46d260f1dd126c442ff06bcaf493d067a4116
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-06-15 (Thu, 15 Jun 2023)

  Changed paths:
    M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
    A Source/WebGPU/WGSL/tests/valid/runtime-sized-array-resource.wgsl

  Log Message:
  -----------
  [WGSL] Use array<T, 1> syntax to serialize runtime-sized array
https://bugs.webkit.org/show_bug.cgi?id=258085
rdar://110789289

Reviewed by Dan Glastonbury.

In 259611 at main we started serializing runtime-sized arrays. The original implementation
used C-style syntax, and doesn't work with references to arrays, as the generated code
becomes `T& t[1]`, which is parsed as an array of references, and therefore invalid.
This is easily fixed by using the same syntax we use for constant-sized arrays, and
becomes `array<T, 1>& t`.

* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::visit):
(WGSL::Metal::FunctionDefinitionWriter::visitGlobal):
* Source/WebGPU/WGSL/tests/valid/runtime-sized-array-resource.wgsl: Added.

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




More information about the webkit-changes mailing list