yum-mirror/slang

Making it easier to work with shaders

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

ArielG-NVFix invalid code generation for when using nested resource specialization (#4751)fef0a87dd

master
597 B31 linesraw
1//TEST:SIMPLE(filecheck=CHECK_DXIL):-target dxil -entry computeMain -profile cs_6_2
2//CHECK_DXIL: computeMain
3
4// This test demonstrates out parameter with a struct & resource type.
5    
6RWTexture1D<int> g_t;
7
8RWStructuredBuffer<int> outputBuffer;
9
10struct Thing
11{
12    int a;
13    RWTexture1D<int> t;
14};
15
16void setThing(out Thing t)
17{
18    t.a = 10;
19    t.t = g_t;
20}
21
22[numthreads(4, 4, 1)]
23void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
24{
25    int x = dispatchThreadID.x;
26   
27    Thing thing;
28    setThing(thing);
29        
30    outputBuffer[dispatchThreadID.x] = x + thing.t.Load(1); 
31}