yum-mirror/slang

Making it easier to work with shaders

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

Yong HeImproved SCCP, inlining and resource specialization passes, legalize `ImageSubscript` for GLSL (#2146)c31577953

master
692 B25 linesraw
1//TEST(compute,vulkan):COMPARE_COMPUTE_EX:-vk -slang -compute -shaderobj
2
3//TEST_INPUT:ubuffer(data=[9 9 9 9], stride=4):out,name=outputBuffer
4RWStructuredBuffer<int> outputBuffer;
5
6static const uint kConstant = 5;
7
8[numthreads(4, 1, 1)]
9void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
10{
11    float x = 1.0;
12    switch(kConstant)
13    {
14    case 5:
15        int tid = int(dispatchThreadID.x);
16	    outputBuffer[tid] = 0;
17        break;
18    case 1:
19        ddx(x); // this should trigger glslang error if it doesn't get eliminated by sccp.
20        break;
21    default:
22        ddy(x); // this should trigger glslang error if it doesn't get eliminated by sccp.
23        break;
24    }
25}