[webkit-changes] [WebKit/WebKit] baa3a7: [WGSL] Fix argument buffer generation when using e...

Tadeu Zagallo noreply at github.com
Mon Oct 16 18:50:42 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: baa3a7fc959adc64f4cf77ee5319a3266461d54a
      https://github.com/WebKit/WebKit/commit/baa3a7fc959adc64f4cf77ee5319a3266461d54a
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-10-16 (Mon, 16 Oct 2023)

  Changed paths:
    M Source/WebGPU/WGSL/GlobalVariableRewriter.cpp
    M Source/WebGPU/WGSL/MangleNames.cpp
    M Source/WebGPU/WGSL/WGSL.h
    M Source/WebGPU/WebGPU/Pipeline.mm
    M Source/WebGPU/WebGPU/ShaderModule.mm

  Log Message:
  -----------
  [WGSL] Fix argument buffer generation when using explicit layouts
https://bugs.webkit.org/show_bug.cgi?id=262956
rdar://116739149

Reviewed by Dan Glastonbury and Mike Wyrzykowski.

Originally, the global rewriter was written with only auto layouts in mind, so it
always generated a new layout instead of consulting the user-provided layout when
there is one. The biggest change required was in `insertStructs`, where we either
use the information we discovered about which globals are used to create the
argument buffer structs, or the new path, where we use the user-provided bind group
layouts to generate the same structs.

* Source/WebGPU/WGSL/GlobalVariableRewriter.cpp:
(WGSL::RewriteGlobalVariables::RewriteGlobalVariables):
(WGSL::RewriteGlobalVariables::run):
(WGSL::RewriteGlobalVariables::collectGlobals):
(WGSL::RewriteGlobalVariables::visitEntryPoint):
(WGSL::RewriteGlobalVariables::determineUsedGlobals):
(WGSL::RewriteGlobalVariables::insertStructs):
(WGSL::RewriteGlobalVariables::createArgumentBufferEntry):
(WGSL::RewriteGlobalVariables::finalizeArgumentBufferStruct):
(WGSL::RewriteGlobalVariables::insertParameters):
* Source/WebGPU/WGSL/MangleNames.cpp:
(WGSL::NameManglerVisitor::run):
* Source/WebGPU/WGSL/WGSL.h:
* Source/WebGPU/WebGPU/ShaderModule.mm:
(WebGPU::ShaderModule::convertPipelineLayout):

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




More information about the webkit-changes mailing list