-
Notifications
You must be signed in to change notification settings - Fork 694
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPIRV] Check if decl is identifier before getting name (#7012)
We hit an assert when trying to get the name of `operator()`. This is fixed by first checking if it function declatarion is an identifier. Fixes #6973
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// RUN: %dxc -T cs_6_0 -E main -spirv -fcgl %s -spirv | FileCheck %s | ||
|
||
|
||
// CHECK: %src_main = OpFunction %void | ||
// CHECK: OpFunctionCall %void %S_operator_Call %s | ||
// CHECK: OpFunctionEnd | ||
// CHECK: %S_operator_Call = OpFunction %void None | ||
// CHECK-NEXT: OpFunctionParameter | ||
// CHECK-NEXT: OpLabel | ||
// CHECK-NEXT: OpReturn | ||
// CHECK-NEXT: OpFunctionEnd | ||
|
||
|
||
struct S | ||
{ | ||
void operator()(); | ||
}; | ||
|
||
void S::operator()() | ||
{ | ||
} | ||
|
||
[numthreads(8,8,1)] | ||
void main(uint32_t3 gl_GlobalInvocationID : SV_DispatchThreadID) | ||
{ | ||
S s; | ||
s(); | ||
} | ||
|