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
701 B23 linesraw
1//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -compile-arg -obfuscate -shaderobj 
2//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -compile-arg -obfuscate -shaderobj
3
4//TEST_INPUT:ubuffer(data=[0 1 2 3], stride=4):name a
5RWStructuredBuffer<int> a;
6//TEST_INPUT:ubuffer(data=[0 2 4 6], stride=4):name b
7RWStructuredBuffer<int> b;
8
9//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name output
10RWStructuredBuffer<int> output;
11
12int doThing(RWStructuredBuffer<int> buf, int index)
13{
14    return buf[index];
15}
16
17[numthreads(16, 1, 1)]
18void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
19{
20    int tid = int(dispatchThreadID.x); 
21
22    output[tid] = doThing(a, tid) | doThing(b, tid);
23}