Skip to content

Commit c88adf5

Browse files
committed
Test for link time constants
This test exercises link time constants used by modules that are precompiled to SPIR-V. Work on shader-slang#6524
1 parent 55dd2de commit c88adf5

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// TEST_IGNORE_FILE
2+
3+
// export-library-global.slang
4+
5+
export static int myGlobalVar = 42;
6+
7+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//TEST:COMPILE: tests/library/precompiled-spirv-global.slang -o tests/library/precompiled-spirv-global.slang-module -target spirv -embed-downstream-ir
2+
3+
//import "export-library-global.slang"; //This would make the test pass
4+
5+
extern int myGlobalVar; //This makes the test fail
6+
7+
layout(location = 0) out float4 fragColor;
8+
9+
[shader("fragment")]
10+
void main() {
11+
fragColor = float4(myGlobalVar);
12+
}

0 commit comments

Comments
 (0)