Skip to content

Commit 9e12e56

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 5d6578b commit 9e12e56

4 files changed

+21
-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

tests/expected-failure.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ tests/language-feature/saturated-cooperation/fuse.slang (vk)
55
tests/bugs/byte-address-buffer-interlocked-add-f32.slang (vk)
66
tests/ir/loop-unroll-0.slang.1 (vk)
77
tests/hlsl-intrinsic/texture/float-atomics.slang (vk)
8+
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)