yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
43df1da01
master
1//TEST(compute):COMPARE_COMPUTE: -compute -shaderobj -output-using-type 2//TEST(compute, vulkan):COMPARE_COMPUTE: -vk -compute -shaderobj -output-using-type 3//TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl -output-using-type 4 5// Test that matrix swizzle writes work correctly 6// Matrix swizzles can either be one or zero indexed 7// Reference: https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-per-component-math 8 9//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer 10RWStructuredBuffer<float> outputBuffer; 11 12[numthreads(4, 1, 1)] 13void computeMain(uint tid : SV_GroupIndex) 14{ 15 // 0 0 16 // 0 0 17 float2x2 m = float2x2(0); 18 19 // 0 1 20 // 4 0 21 m._12_21 = float2(1, 4); 22 23 // 2 1 24 // 4 3 25 m._m00_m11 = float2(2, 3); 26 27 outputBuffer[tid] = m[tid/2][tid%2]; 28}