yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
a43b3c4d0
master
1//TEST:COMPARE_COMPUTE_EX: -slang -compute 2 3//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer 4RWStructuredBuffer<float> outputBuffer; 5 6struct SomeType 7{ 8 float2x2 v; 9}; 10 11float mul(SomeType a, float2 v) { return mul(a.v, v).x; } 12 13[numthreads(4, 1, 1)] 14void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) 15{ 16 uint tid = dispatchThreadID.x; 17 18 float inVal = float(tid); 19 20 float2 v = float2(inVal, inVal + 2); 21 SomeType t = { inVal + 1, 0, 1, 0 }; 22 23 outputBuffer[tid] = mul(t, v).x; 24}