yum-mirror/slang

Making it easier to work with shaders

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

Darren WihandiFix matrix division by scalar for Metal and WGSL targets (#6752)705d00ab8

master
749 B21 linesraw
1//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -compute -entry computeMain -output-using-type
2//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-metal -compute -entry computeMain -output-using-type
3//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-wgpu -compute -entry computeMain -output-using-type
4
5//TEST_INPUT:ubuffer(data=[3.5], stride=4):name inputBuffer
6StructuredBuffer<float> inputBuffer;
7
8//TEST_INPUT:ubuffer(data=[0 0], stride=4):out,name outputBuffer
9RWStructuredBuffer<float> outputBuffer;
10
11[shader("compute")]
12[numthreads(1, 1, 1)]
13void computeMain()
14{
15    // CHECK: 6.0
16    outputBuffer[0] = (float3x3(15.0) / 2.5)[0][0];
17
18    // CHECK: 4.0
19    outputBuffer[1] = (float4x4(14.0) / inputBuffer[0])[0][0];
20}
21