yum-mirror/slang

Making it easier to work with shaders

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

skallweitNVenable more metal tests (#4326)712ce653d

master
774 B25 linesraw
1//TEST(compute):COMPARE_COMPUTE_EX:-cuda -compute -shaderobj
2//TEST(compute):COMPARE_COMPUTE_EX:-cpu -compute -compile-arg -O3 -shaderobj
3//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
4//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 -shaderobj
5//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj
6
7
8//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer
9RWStructuredBuffer<int> outputBuffer;
10
11void writeArray(inout float3 a[4])
12{
13    a[0] = float3(1, 1, 1);
14    a[1] = float3(1, 1, 1);
15    a[2] = float3(1, 1, 1);
16    a[3] = float3(1, 1, 1);    
17}
18
19[numthreads(4, 1, 1)]
20void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
21{
22    float3 b[4];
23    writeArray(b);
24	outputBuffer[dispatchThreadID.x] = int(b[0].x);
25}