yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Jay KwakUse disassemble API from SPIRV-Tools (#6001)5621ace93

master
800 B42 linesraw
1//TEST:SIMPLE(filecheck=CHECK): -target spirv -emit-spirv-directly -entry main -stage compute
2//TEST:SIMPLE(filecheck=CHECK_IGNORE_CAPS): -target spirv -emit-spirv-directly -entry main -stage compute -ignore-capabilities -skip-spirv-validation
3// CHECK_IGNORE_CAPS-NOT: error 36108
4
5// Test that capabilities can be declared on module.
6[require(glsl)]
7[require(spirv)]
8module test;
9
10RWStructuredBuffer<int> sideEffect;
11
12// CHECK: error {{(36107|36108)}}
13[require(glsl, _sm_4_0)]
14public void use1()
15{
16    __target_switch
17    {
18    case glsl:
19        return;
20    }
21}
22
23void use2Sub()
24{
25    __target_switch
26    {
27    case glsl:
28        sideEffect[1] = 1;
29    }
30}
31// CHECK: error {{(36107|36108)}}
32[require(spirv, spirv_1_0)]
33public void use2()
34{
35    use2Sub();
36}
37
38void main()
39{
40    use1();
41    use2();
42}