[webkit-changes] [WebKit/WebKit] 5d6541: [WGSL] Move logic to handle global references into...

Tadeu Zagallo noreply at github.com
Fri May 26 02:47:28 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5d6541ead5140df5a918ad857033c325ddadbf6a
      https://github.com/WebKit/WebKit/commit/5d6541ead5140df5a918ad857033c325ddadbf6a
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-05-26 (Fri, 26 May 2023)

  Changed paths:
    M Source/WebGPU/WGSL/AST/ASTVariable.h
    M Source/WebGPU/WGSL/GlobalVariableRewriter.cpp
    M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
    M Source/WebGPU/WGSL/TypeCheck.cpp
    M Source/WebGPU/WGSL/Types.cpp
    M Source/WebGPU/WGSL/Types.h

  Log Message:
  -----------
  [WGSL] Move logic to handle global references into serialization
https://bugs.webkit.org/show_bug.cgi?id=257275
rdar://109789455

Reviewed by Mike Wyrzykowski.

Instead of trying to decide whether a given global should be a reference by looking
at its type during rewriting, now that we have proper knowledge about address spaces
we can greatly simply this logic by consistently using references for all globals,
which is semantically correct, and handling this in the serializaiton stage.

* Source/WebGPU/WGSL/AST/ASTVariable.h:
* Source/WebGPU/WGSL/GlobalVariableRewriter.cpp:
(WGSL::RewriteGlobalVariables::visitCallee):
(WGSL::RewriteGlobalVariables::usesOverride):
(WGSL::RewriteGlobalVariables::insertStructs):
(WGSL::RewriteGlobalVariables::insertMaterializations):
(WGSL::RewriteGlobalVariables::shouldBeReference const): Deleted.
* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::serializeVariable):
(WGSL::Metal::FunctionDefinitionWriter::visit):
* Source/WebGPU/WGSL/TypeCheck.cpp:
(WGSL::TypeChecker::visitVariable):
* Source/WebGPU/WGSL/Types.cpp:
(WGSL::isPrimitive):
(WGSL::isPrimitiveReference):
* Source/WebGPU/WGSL/Types.h:

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




More information about the webkit-changes mailing list