Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8364b025cf0649b2f3a4eae233a496cac9e0e232
      
https://github.com/WebKit/WebKit/commit/8364b025cf0649b2f3a4eae233a496cac9e0e232
  Author: Tadeu Zagallo <tzaga...@apple.com>
  Date:   2023-05-18 (Thu, 18 May 2023)

  Changed paths:
    M Source/WebGPU/WGSL/EntryPointRewriter.cpp

  Log Message:
  -----------
  [WGSL] EntryPointRewriter is skipping materializations
https://bugs.webkit.org/show_bug.cgi?id=256966
rdar://109515526

Reviewed by Mike Wyrzykowski and Dan Glastonbury.

The EntryPointRewriter would return early when `m_parameters` was empty. 
`m_parameters`
holds parameters that were moved into the stage_in struct. Before early 
returning, it
also called `appendBuiltins`, which inserted all the built-in inputs into 
function's
parameters, whether those were already parameters to begin with, or were 
hoisted from
a struct parameter, since Metal doesn't allow built-ins in structs. However, we 
were
missing that we could have an empty `m_parameters`, but still have values in 
`m_materializations`,
which holds the operations we might need to reconstruct struct arguments whose 
fields
got hoisted into the function's top-level parameters. To make the code less 
error-prone,
I removed the early return and instead conditionally apply each of the steps: 
append the
built-in parameters, construct the stage_in struct and materialize 
(user-defined) struct
inputs.

* Source/WebGPU/WGSL/EntryPointRewriter.cpp:
(WGSL::EntryPointRewriter::rewrite):

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


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

Reply via email to