yum-mirror/slang

Making it easier to work with shaders

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

Yong HeWarning on lossy implicit casts. (#2367)adaea0e99

master
480 B28 linesraw
1// gl-33.slang
2//TEST(compute):COMPARE_COMPUTE: -shaderobj
3
4// Test for GitLab issue # 33
5
6import gl_33_ext;
7
8typedef A B;
9
10int test(int val)
11{
12    B b = { val };
13    return b.next();
14}
15
16//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name gBuffer
17RWStructuredBuffer<int> gBuffer;
18
19[numthreads(4, 1, 1)]
20void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
21{
22    uint tid = dispatchThreadID.x;
23
24    int val = int(tid);
25    val = test(val);
26
27    gBuffer[tid] = val;
28}