-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Precompiled SPIR-V import support #5048
Merged
cheneym2
merged 10 commits into
shader-slang:master
from
cheneym2:cheneym2/slang_issue_4992
Oct 29, 2024
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
69658c7
Precompiled SPIR-V import support
cheneym2 a6cffd3
Address review comments
cheneym2 f6ab6f0
Address review feedback
cheneym2 1a66d21
Pointer decorations on spv function params
cheneym2 50bad06
Emit pointer decoration
cheneym2 042412a
Merge branch 'master' into cheneym2/slang_issue_4992
cheneym2 f9d18b1
Update slang-emit-spirv.cpp
cheneym2 b811642
Update slang-emit-spirv.cpp
cheneym2 235a816
Merge branch 'master' into cheneym2/slang_issue_4992
csyonghe 7a58c66
Update slang-emit-spirv.cpp
cheneym2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,10 @@ | ||
//TEST_IGNORE_FILE: | ||
|
||
// module-library-pointer-param.slang | ||
|
||
module "module-library-pointer-param"; | ||
|
||
public int ptrFunc(int* a) | ||
{ | ||
return *a; | ||
} |
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,31 @@ | ||
// precompiled-spirv-pointer-param.slang | ||
|
||
// A test that uses slang-modules with embedded precompiled SPIRV and a library containing | ||
// a function with a pointer parameter. | ||
// The test compiles a library slang (module-library-pointer-param.slang) with -embed-downstream-ir then links the | ||
// library to entrypoint slang (this file). | ||
// The test passes if there is no errror thrown. | ||
// TODO: Check if final linkage used only the precompiled spirv. | ||
|
||
//TEST:COMPILE: tests/library/module-library-pointer-param.slang -o tests/library/module-library-pointer-param.slang-module -target spirv -embed-downstream-ir -incomplete-library | ||
//TEST:COMPILE: tests/library/precompiled-spirv-pointer-param.slang -target spirv -stage anyhit -entry anyhit -o tests/library/linked.spirv | ||
|
||
import "module-library-pointer-param"; | ||
|
||
struct Payload | ||
{ | ||
int val; | ||
} | ||
|
||
struct Attributes | ||
{ | ||
float2 bary; | ||
} | ||
|
||
[vk::push_constant] int* g_int; | ||
|
||
[shader("anyhit")] | ||
void anyhit(inout Payload payload, Attributes attrib) | ||
{ | ||
payload.val = ptrFunc(g_int); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added pointer decoration