yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
712ce653d
master
1//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -shaderobj 2 3module test; 4 5import m; 6 7namespace ns1.ns2 8{ 9 int f() 10 { 11 // Should be able to access g() from m. 12 return g(); 13 } 14} 15 16using ns1.ns2; 17 18//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer 19RWStructuredBuffer<int> outputBuffer; 20 21[numthreads(4, 1, 1)] 22void computeMain(int3 dispatchThreadID : SV_DispatchThreadID) 23{ 24 int tid = dispatchThreadID.x; 25 int inVal = tid; 26 int outVal = f() + g() + ns1.ns2.g(); 27 outputBuffer[tid] = outVal; 28 // CHECK: 3 29}