yum-mirror/slang

Making it easier to work with shaders

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

Tim FoleyConvert more tests to use shader objects (#1659)2a5d5b323

master
812 B29 linesraw
1//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
2//TEST(compute,vulkan):COMPARE_COMPUTE_EX:-vk -slang -compute -shaderobj
3//TEST(compute):COMPARE_COMPUTE_EX:-cpu -slang -compute -shaderobj
4//TEST(compute):COMPARE_COMPUTE_EX:-cuda -slang -compute -shaderobj
5
6//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out, name outputBuffer
7RWStructuredBuffer<int> outputBuffer;
8
9[numthreads(4, 1, 1)]
10void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
11{
12    int index = int(dispatchThreadID.x);   
13    
14    int a = index;
15    
16    // This is kind of silly - but it is a valid construct.
17    // We want to check condition expression is executed though
18    switch (++a)
19    {
20    }
21
22    switch (index)
23    {
24        // This should not be executed
25        a += 10;
26    }
27
28    outputBuffer[index] = a;
29}