[webkit-changes] [WebKit/WebKit] 074a78: [WGSL] Initial support for packing and unpacking v...
Tadeu Zagallo
noreply at github.com
Wed Jun 7 23:00:48 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 074a78d9d7fba2ccf27d4d98fd25cdddb638a498
https://github.com/WebKit/WebKit/commit/074a78d9d7fba2ccf27d4d98fd25cdddb638a498
Author: Tadeu Zagallo <tzagallo at 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 at 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
More information about the webkit-changes
mailing list