Skip to content

Commit 5f1fd33

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 5f1fd33

3 files changed

+20
-0
lines changed

tests/expected-failure-github.txt

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ tests/language-feature/shader-params/interface-shader-param-ordinary.slang.4 syn
1414
tests/glsl-intrinsic/shader-subgroup/shader-subgroup-builtin-variables.slang.8 (mtl)
1515
tests/glsl-intrinsic/shader-subgroup/shader-subgroup-builtin-variables-2.slang.3 (mtl)
1616
tests/hlsl-intrinsic/texture/partial-resident-texture-combined.slang (dx12)
17+
tests/library/precompiled-spirv-global.slang
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)