Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: baa3a7fc959adc64f4cf77ee5319a3266461d54a
      
https://github.com/WebKit/WebKit/commit/baa3a7fc959adc64f4cf77ee5319a3266461d54a
  Author: Tadeu Zagallo <tzaga...@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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to