yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
1c2c4908c
master
1//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type 2//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type 3//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-cpu -compute -shaderobj -output-using-type 4//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-cuda -compute -shaderobj -output-using-type 5 6//TEST_INPUT:ubuffer(data=[0], stride=4):out,name outputBuffer 7RWStructuredBuffer<float> outputBuffer; 8 9float test(float3x3 m3) 10{ 11 return m3[0][0] + m3[1][1] + m3[2][2]; 12} 13 14[numthreads(4, 1, 1)] 15void computeMain(uint3 dispatchThreadID: SV_DispatchThreadID) 16{ 17 float4x4 m = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; 18 float3x3 m3 = float3x3(m); 19 outputBuffer[0] = test(m3); // Expect 18 20}