[webkit-changes] [WebKit/WebKit] 80357a: [WGSL] Add `role`s to structs and parameters to ai...

Tadeu Zagallo noreply at github.com
Wed Jan 25 02:45:11 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 80357a24d696b3f75ff143d2bb790b7dc37c38a9
      https://github.com/WebKit/WebKit/commit/80357a24d696b3f75ff143d2bb790b7dc37c38a9
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-01-25 (Wed, 25 Jan 2023)

  Changed paths:
    M Source/WebGPU/WGSL/AST/ASTFunctionDecl.h
    M Source/WebGPU/WGSL/AST/ASTStructureDecl.h
    M Source/WebGPU/WGSL/EntryPointRewriter.cpp
    M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
    M Source/WebGPU/WGSL/Parser.cpp

  Log Message:
  -----------
  [WGSL] Add `role`s to structs and parameters to aid codegen
https://bugs.webkit.org/show_bug.cgi?id=251089
<rdar://problem/104602741>

Reviewed by Myles C. Maxfield.

Add a field to indicate what is the role of structs and parameters. That
helps with codegen as we can identify as if a struct or parameter was generated
for a specific purposed, e.g. to receive stage_in parameters. This extra information
helps when choosing the right metal attributes during codegen.

* Source/WebGPU/WGSL/AST/ASTFunctionDecl.h:
* Source/WebGPU/WGSL/AST/ASTStructureDecl.h:
* Source/WebGPU/WGSL/EntryPointRewriter.cpp:
(WGSL::EntryPointRewriter::EntryPointRewriter):
(WGSL::EntryPointRewriter::rewrite):
(WGSL::EntryPointRewriter::constructInputStruct):
(WGSL::EntryPointRewriter::appendBuiltins):
(WGSL::rewriteEntryPoints):
* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::visit):
* Source/WebGPU/WGSL/Parser.cpp:
(WGSL::Parser<Lexer>::parseStructDecl):
(WGSL::Parser<Lexer>::parseParameter):

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




More information about the webkit-changes mailing list