yum-mirror/slang

Making it easier to work with shaders

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

Yong HeFix div-by-zero error during sccp. (#2911)5dd401e41

master
416 B19 linesraw
1//TEST:SIMPLE(filecheck=CHECK): -entry computeMain -profile cs_5_0 -target hlsl
2RWStructuredBuffer<uint> outputBuffer;
3
4// CHECK: divide by zero
5uint check<let b : bool>()
6{
7    return 1 / int(b);
8}
9
10[numthreads(4, 1, 1)]
11void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
12{
13	uint tid = dispatchThreadID.x;
14    
15    uint a = check<false>();
16    uint b = check<true>();
17    
18	outputBuffer[tid] = a + b; 
19}