yum-mirror/slang

Making it easier to work with shaders

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

ArielG-NVInitial pass to add capability declarations to stdlib intrinsics. (#3912)f9bcad355

master
646 B32 linesraw
1//TEST:SIMPLE(filecheck=CHECK): -target cpp -entry computeMain -stage compute -allow-glsl
2
3// CHECK: computeMain(
4
5layout(binding = 0) buffer MyBlockName
6{
7    int v[1];
8} outputBuffer;
9
10// `default` only should try to define `glsl`, but glsl target is 
11// present in a `case` statment. Therefore this code should error
12// since cpp is missing a target for a function called
13[require(cpp_glsl)]
14void someInternalFunc()
15{
16    __target_switch
17    {
18    case glsl:
19        outputBuffer.v[0] = 0;
20    default:
21        outputBuffer.v[0] = 0;
22    }
23}
24void someMin()
25{
26    someInternalFunc();
27}
28[numthreads(1,1,1)]
29void computeMain()
30{
31    someMin();
32}