yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Anders LeinoEnable a bunch of WGPU tests (#5513)43df1da01

master
629 B22 linesraw
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 writes to single matrix elements with swizzles work
6
7//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
8RWStructuredBuffer<float> outputBuffer;
9
10[numthreads(4, 1, 1)]
11void computeMain(uint tid : SV_GroupIndex)
12{
13    // 0 0
14    // 0 0
15    float2x2 m = float2x2(0);
16
17    // 0 2
18    // 0 0
19    const float x = m._m01 = 2;
20
21    outputBuffer[tid] = x + m[tid/2][tid%2];
22}