yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f02b08490
master
1//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-slang -compute -dx12 -shaderobj -xslang -matrix-layout-row-major 2//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-slang -compute -dx12 -shaderobj -xslang -matrix-layout-column-major 3//TEST(compute, vulkan):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-vk -compute -shaderobj -xslang -matrix-layout-row-major 4//TEST(compute, vulkan):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-vk -compute -shaderobj -xslang -matrix-layout-column-major 5//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-cuda -compute -shaderobj 6 7//TEST_INPUT:ubuffer(data=[0], stride=4):out,name outputBuffer 8RWStructuredBuffer<int> outputBuffer; 9 10[numthreads(1, 1, 1)] 11void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) 12{ 13 float2x2 matrix2x2_1 = float2x2(1, 2, 3, 4); 14 float4 vector4_1 = (float4)matrix2x2_1; 15 16 float4 vector4_2 = float4(1, 2, 3, 4); 17 float2x2 matrix2x2_2 = (float2x2)vector4_2; 18 19 outputBuffer[0] = uint(true 20 && all(vector4_1 == float4(1, 2, 3, 4)) 21 && all(matrix2x2_2[0] == float2(1,2)) 22 && all(matrix2x2_2[1] == float2(3,4)) 23 ); 24 //BUF: 1 25}