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 MyPoint { int x; int y; int type; } 4 5struct Params{ 6 MyPoint data[2]; 7} 8 9//TEST_INPUT:set params = cbuffer(data=[0 1 2 3 4 5 6 7 8 9 10 11]) 10ConstantBuffer<Params> params; 11 12//TEST_INPUT:set outputBuffer = out ubuffer(data=[0 0 0 0], stride=4) 13RWStructuredBuffer<float> outputBuffer; 14 15[numthreads(1,1,1)] 16void computeMain() 17{ 18 // CHECK: 5 19 outputBuffer[0] = params.data[1].y; 20} 21