yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
b86703432
master
1//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=CHECK):-slang -compute -wgpu -output-using-type 2 3struct Params{ 4 int2 data[2]; 5 int scalarData[2]; 6} 7 8//TEST_INPUT:set params = cbuffer(data=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]) 9ConstantBuffer<Params> params; 10 11//TEST_INPUT:set outputBuffer = out ubuffer(data=[0 0 0 0], stride=4) 12RWStructuredBuffer<float> outputBuffer; 13 14float helper(float2 v) 15{return v.y;} 16 17[numthreads(1,1,1)] 18void computeMain() 19{ 20 // CHECK: 17 21 outputBuffer[0] = helper(params.data[1]) + params.scalarData[1]; 22} 23