-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WGSL] Add support for address-of and indirection operators
https://bugs.webkit.org/show_bug.cgi?id=261833 <rdar://problem/115795658> Reviewed by Dan Glastonbury. Add the type declarations for address-of (&x, spec[1]) and indirection (*x, spec[2]) operators. This required introducing AbstractReference and AbstractPointer to the overload resolution algorithm and exposing them to the ruby DSL, as well as exposing address space and access mode, which was done by generalizing NumericVariables to use the underlying enum type. [1]: https://www.w3.org/TR/WGSL/#address-of-expr [2]: https://www.w3.org/TR/WGSL/#indirection-expr * Source/WebGPU/WGSL/Constraints.cpp: (WGSL::satisfies): (WGSL::satisfyOrPromote): * Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp: (WGSL::Metal::FunctionDefinitionWriter::visit): * Source/WebGPU/WGSL/Overload.cpp: (WGSL::OverloadResolver::OverloadResolver): (WGSL::OverloadResolver::materialize const): (WGSL::OverloadResolver::considerCandidate): (WGSL::OverloadResolver::calculateRank): (WGSL::OverloadResolver::unify): (WGSL::OverloadResolver::assign): (WGSL::OverloadResolver::resolve const): (WGSL::resolveOverloads): (WTF::printInternal): * Source/WebGPU/WGSL/Overload.h: * Source/WebGPU/WGSL/TypeDeclarations.rb: * Source/WebGPU/WGSL/generator/main.rb: * Source/WebGPU/WGSL/tests/valid/overload.wgsl: * Source/WebGPU/WGSL/tests/valid/pointers.wgsl: Canonical link: https://commits.webkit.org/268245@main
- Loading branch information
1 parent
a76cf09
commit 3d505c7
Showing
8 changed files
with
176 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.