[webkit-changes] [WebKit/WebKit] b2e093: [WGSL] Override evaluation fails when one variable...

Tadeu Zagallo noreply at github.com
Fri Sep 27 02:19:51 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b2e093e2b9e12e09385ffcc3ce269cbc279b530b
      https://github.com/WebKit/WebKit/commit/b2e093e2b9e12e09385ffcc3ce269cbc279b530b
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2024-09-27 (Fri, 27 Sep 2024)

  Changed paths:
    A LayoutTests/fast/webgpu/regression/repro_280423-expected.txt
    A LayoutTests/fast/webgpu/regression/repro_280423.html
    M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
    M Source/WebGPU/WGSL/WGSL.cpp
    M Source/WebGPU/WGSL/wgslc.cpp
    M Source/WebGPU/WebGPU/Pipeline.mm

  Log Message:
  -----------
  [WGSL] Override evaluation fails when one variables depends on another
https://bugs.webkit.org/show_bug.cgi?id=280423
rdar://135707429

Reviewed by Mike Wyrzykowski.

There were 3 issues when one override variable referred to another:
- Default initializers were evaluated before user-provided values, but that fails
  the default initializer refers to a variable that has a user-provided value
- Override values were stored in the hash map with their original name as key
  (instead of the mangled name), so even if a default initializer referred to
  another variable that had a value, it wouldn't find it in the hash map.
- The case were the default initializer referred to a variable that didn't have
  a value wasn't handled. That happened when the referred variable didn't have
  a default initializer and a value wasn't provided through the API.

Additionally, the implementation was somewhat duplicated between the API and
the code generator, both created a similar dictionary of replacement values,
which was redundant. The logic is now completely removed from the code generator,
and to keep `wgslc` working, it now contains a simpler version of the logic that
exists in the API.

* LayoutTests/fast/webgpu/regression/repro_136222279-expected.txt: Added.
* LayoutTests/fast/webgpu/regression/repro_136222279.html: Added.
* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::write):
(WGSL::Metal::FunctionDefinitionWriter::visit):
(WGSL::Metal::FunctionDefinitionWriter::visitGlobal): Deleted.
* Source/WebGPU/WGSL/WGSL.cpp:
(WGSL::evaluate):
* Source/WebGPU/WGSL/wgslc.cpp:
(runWGSL):
* Source/WebGPU/WebGPU/Pipeline.mm:
(WebGPU::createLibrary):

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list