[webkit-changes] [WebKit/WebKit] 920eba: [WebGPU] ShaderModule::createLibrary may produce i...

Tadeu Zagallo noreply at github.com
Fri Feb 9 08:34:43 PST 2024


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

  Changed paths:
    M Source/WebGPU/WGSL/GlobalVariableRewriter.cpp
    M Source/WebGPU/WGSL/GlobalVariableRewriter.h
    M Source/WebGPU/WGSL/WGSL.cpp
    M Source/WebGPU/WGSL/WGSL.h
    M Source/WebGPU/WGSL/wgslc.cpp
    M Source/WebGPU/WebGPU/Pipeline.mm
    M Source/WebGPU/WebGPU/ShaderModule.mm
    M Tools/TestWebKitAPI/Tests/WGSL/MetalGenerationTests.cpp

  Log Message:
  -----------
  [WebGPU] ShaderModule::createLibrary may produce invalid metal with custom layouts
https://bugs.webkit.org/show_bug.cgi?id=268898
rdar://122256850

Reviewed by Mike Wyrzykowski.

The global variable rewriter should return an error when the shader is incompatible with
the user-provided layout, in order to avoid generating invalid Metal code.

* Source/WebGPU/WGSL/GlobalVariableRewriter.cpp:
(WGSL::RewriteGlobalVariables::run):
(WGSL::RewriteGlobalVariables::visitEntryPoint):
(WGSL::RewriteGlobalVariables::insertStructs):
(WGSL::rewriteGlobalVariables):
* Source/WebGPU/WGSL/GlobalVariableRewriter.h:
* Source/WebGPU/WGSL/WGSL.cpp:
(WGSL::staticCheck):
(WGSL::prepareImpl):
(WGSL::prepare):
* Source/WebGPU/WGSL/WGSL.h:
* Source/WebGPU/WGSL/wgslc.cpp:
(runWGSL):
* Source/WebGPU/WebGPU/Pipeline.mm:
(WebGPU::createLibrary):
* Source/WebGPU/WebGPU/ShaderModule.mm:
(WebGPU::earlyCompileShaderModule):

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




More information about the webkit-changes mailing list