-
Notifications
You must be signed in to change notification settings - Fork 722
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add linkage capability based on decorations (#6900)
We currently add the linkage attribute only if there are no extry pointer. However, there are cases where we may want an extry point with an exported function. This commit add the linkage capability any time it sees the linkage attribute decoration. Note I do not add the linkage attribute all of the time and leave it to the capability trimming pass because having this capability with vulkan shaders is generally illegal, and I don't want the unoptimized code to fail validation. Fixes #6738
- Loading branch information
Showing
4 changed files
with
23 additions
and
11 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
13 changes: 13 additions & 0 deletions
13
tools/clang/test/CodeGenSPIRV/fn.export.with.entrypoint.hlsl
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,13 @@ | ||
// RUN: %dxc -T as_6_6 -E main -fspv-target-env=vulkan1.3 -fcgl %s -spirv | FileCheck %s | ||
|
||
// CHECK: OpCapability Linkage | ||
// CHECK: OpDecorate %external_function LinkageAttributes "external_function" Export | ||
export int external_function() { | ||
return 1; | ||
} | ||
|
||
[numthreads(8, 8, 1)] | ||
void main() { | ||
external_function(); | ||
return; | ||
} |
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