yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
1fb3c1536
master
1//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -shaderobj 2 3module test; 4 5namespace test 6{ 7 vector<uint, N> f<int N>(vector<uint, N> x) 8 { 9 return x; 10 } 11} 12 13//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer 14RWStructuredBuffer<int> outputBuffer; 15 16[numthreads(1, 1, 1)] 17void computeMain(int3 dispatchThreadID : SV_DispatchThreadID) 18{ 19 int tid = dispatchThreadID.x; 20 int inVal = tid; 21 // Should be able to resolve 'test' properly (and not get confused by the module declaration with the same name) 22 int outVal = test.f<3>(vector<uint, 3>(1, 2, 3)).y; 23 outputBuffer[tid] = outVal; 24 // CHECK: 2 25}