yum-mirror/slang

Making it easier to work with shaders

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

jsmall-nvidiaFix for generic with scope issue (#2925)79b0a2a55

master
890 B46 linesraw
1//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
2
3struct Test1
4{
5    struct A<let N : uint = 2>
6    {
7        static uint num() { return N; }
8    };
9
10    static uint num() { return A<2>::num(); }
11
12    typealias B = A<2>;
13};
14
15struct Test2
16{};
17
18extension Test2
19{
20    struct A<let N : uint = 2>
21    {
22        static uint num() { return N; }
23    };
24
25    static uint num()
26    {
27        return A<2>::num(); 
28    }
29
30    typealias B = A<2>;
31};
32
33//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0], stride=4):out,name outputBuffer
34RWStructuredBuffer<uint> outputBuffer;
35
36[numthreads(4, 1, 1)]
37void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
38{
39    outputBuffer[0] = Test1::num();
40    outputBuffer[1] = Test1::B::num();
41    outputBuffer[2] = Test1::A<2>::num(); 
42
43    outputBuffer[3] = Test2::num(); 
44    outputBuffer[4] = Test2::B::num();
45    outputBuffer[5] = Test2::A<2>::num(); 
46}