yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
447b7e0e2
master
1//DISABLE_TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj 2 3/* A test meta programing. 4 5Works. 6 */ 7 8//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer 9RWStructuredBuffer<int> outputBuffer; 10 11struct GetVector4<T> 12{ 13 typedef vector<T, 4> Value; 14}; 15 16[numthreads(4, 1, 1)] 17void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) 18{ 19 int index = dispatchThreadID.x; 20 21 GetVector4<float>::Value v = { 1, 2, 3, 4 }; 22 23 outputBuffer[index] = dot(v, v); 24} 25