-
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] Non-entrypoint functions should also be mangled
https://bugs.webkit.org/show_bug.cgi?id=258281 rdar://111004485 Reviewed by Dan Glastonbury. In the mangling pass, although we visited all functions, we only mangled the names of the entry points. * Source/WebGPU/WGSL/MangleNames.cpp: (WGSL::NameManglerVisitor::run): * Source/WebGPU/WGSL/tests/valid/global-used-by-callee.wgsl: * Source/WebGPU/WGSL/tests/valid/name-mangling.wgsl: Added. * Source/WebGPU/WGSL/tests/valid/var-initialization-with-var.wgsl: Canonical link: https://commits.webkit.org/266096@main
- Loading branch information
1 parent
02196eb
commit e0823a9
Showing
4 changed files
with
51 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// RUN: %metal myComputeEntrypoint | %check | ||
|
||
// CHECK-NOT-L: MyStruct1 | ||
struct MyStruct1 { | ||
// FIXME: mangle struct fields | ||
myStructField1: i32, | ||
}; | ||
|
||
// CHECK-NOT-L: MyStruct2 | ||
struct MyStruct2 { | ||
// FIXME: mangle struct fields | ||
myStructField2: MyStruct1, | ||
}; | ||
|
||
// FIXME: this still appears in a struct field | ||
@group(0) @binding(0) var<storage> myGlobal1: MyStruct2; | ||
|
||
// CHECK-NOT-L: myGlobal2 | ||
var<private> myGlobal2: MyStruct2; | ||
|
||
// CHECK-NOT-L: myHelperFunction | ||
fn myHelperFunction() -> i32 | ||
{ | ||
return myGlobal1.myStructField2.myStructField1 + myGlobal2.myStructField2.myStructField1; | ||
} | ||
|
||
// CHECK-NOT-L: myComputeEntrypoint | ||
@compute @workgroup_size(1) | ||
fn myComputeEntrypoint() | ||
{ | ||
_ = myHelperFunction(); | ||
} |
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