yum-mirror/slang

Making it easier to work with shaders

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

kaizhangNVFeature/initialize list side branch (#6058)9ec6b9168

master
705 B35 linesraw
1//DISABLE_TEST:SIMPLE(filecheck=CHECK): -target hlsl -stage compute -entry computeMain
2//DISABLE_TEST:SIMPLE(filecheck=CHECK): -target glsl -stage compute -entry computeMain
3
4// CHECK-NOT: {{.* }}= 0;
5
6RWStructuredBuffer<int> outputBuffer;
7
8struct MyStruct_base
9{
10    int a = 1;
11    int b;
12};
13struct MyStruct : MyStruct_base
14{
15    int c = 1;
16    int d;
17};
18MyStruct getStruct()
19{
20    MyStruct myStruct;
21    return myStruct;
22}
23[numthreads(1, 1, 1)]
24void computeMain(int3 dispatchThreadID: SV_DispatchThreadID)
25{
26    MyStruct myStruct = getStruct();
27
28// BUF: 1
29    outputBuffer[0] = true
30        && myStruct.a == 1
31        && myStruct.b == 0
32        && myStruct.c == 1
33        && myStruct.d == 0
34        ;
35}