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
458 B31 linesraw
1// anyvalue-size-validation.slang
2
3//DIAGNOSTIC_TEST:SIMPLE:-target cpp -stage compute -entry main -disable-specialization
4
5[anyValueSize(8)]
6interface IInterface
7{
8    int doSomething();
9};
10
11struct S : IInterface
12{
13    uint a;
14    uint b;
15    uint c;
16    int doSomething() { return 5; }
17};
18
19T test<T:IInterface>(T s)
20{
21    return s;
22}
23
24RWStructuredBuffer<uint> output;
25
26[numthreads(4, 1, 1)]
27void main()
28{
29    S s = S(1, 2, 3);
30    output[0] = test(s).a;
31}