yum-mirror/slang

Making it easier to work with shaders

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

Yong HeRevert uint<->int implicit cast cost to prefer promotion to unsigned. (#5480)f4d5aa73f

master
438 B20 linesraw
1//TEST:SIMPLE(filecheck=CHECK): -target hlsl -stage compute -entry main
2RWStructuredBuffer<float> result;
3// CHECK-NOT: result{{.*}}[int(0)] = 1
4// CHECK: result{{.*}}[int(0)] = 2
5// CHECK-NOT: result{{.*}}[int(0)] = 1
6[numthreads(1,1,1)]
7void main()
8{
9    int ic = -1;
10    uint a = 2;
11    if (ic < a)
12    {
13        result[0] = 1;
14    }
15    else
16    {
17        // Should pick this branch according to C spec.
18        result[0] = 2;
19    }
20}