yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
fef0a87dd
master
1//TEST:SIMPLE(filecheck=CHECK_DXIL):-target dxil -entry computeMain -profile cs_6_2 2//CHECK_DXIL: computeMain 3 4// This test demonstrates returning struct with resource. 5 6RWTexture1D<int> g_t; 7RWStructuredBuffer<int> outputBuffer; 8 9struct Thing 10{ 11 int a; 12 RWTexture1D<int> t; 13}; 14 15Thing makeThing() 16{ 17 Thing t; 18 t.a = 10; 19 t.t = g_t; 20 return t; 21} 22 23[numthreads(4, 4, 1)] 24void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) 25{ 26 int x = dispatchThreadID.x; 27 Thing thing = makeThing(); 28 outputBuffer[dispatchThreadID.x] = x + thing.t.Load(1); 29}