Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 074a78d9d7fba2ccf27d4d98fd25cdddb638a498
      
https://github.com/WebKit/WebKit/commit/074a78d9d7fba2ccf27d4d98fd25cdddb638a498
  Author: Tadeu Zagallo <tzaga...@apple.com>
  Date:   2023-06-07 (Wed, 07 Jun 2023)

  Changed paths:
    M Source/WebGPU/WGSL/AST/ASTStructure.h
    M Source/WebGPU/WGSL/GlobalVariableRewriter.cpp
    M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
    M Source/WebGPU/WGSL/tests/valid/packing.wgsl

  Log Message:
  -----------
  [WGSL] Initial support for packing and unpacking values on assignment
https://bugs.webkit.org/show_bug.cgi?id=257797
rdar://110389019

Reviewed by Dan Glastonbury.

In 264864@main I started the process of distinguishing between structs that need
to be "packed", i.e. respect the size and alignment of types as defined in the 
WGSL
spec. This is the first patch that introduces explicit convertions between 
packed
and unpacked structs. For now, we only pack/unpack at assignments, which is not
enough, but other patches will follow extending this functionality to other 
operations.

* Source/WebGPU/WGSL/AST/ASTStructure.h:
* Source/WebGPU/WGSL/GlobalVariableRewriter.cpp:
(WGSL::RewriteGlobalVariables::visit):
(WGSL::RewriteGlobalVariables::pack):
(WGSL::RewriteGlobalVariables::getPacking):
(WGSL::RewriteGlobalVariables::packResourceStruct):
* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::write):
(WGSL::Metal::FunctionDefinitionWriter::generatePackingHelpers):
* Source/WebGPU/WGSL/tests/valid/packing.wgsl:

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


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

Reply via email to