yum-mirror/slang

Making it easier to work with shaders

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

Yong He[SPIRV] Support `globallycoherent` and `[vk::index()]`. (#3488)e7b6de334

master
487 B25 linesraw
1// precise-keyword.slang
2
3//TEST:SIMPLE(filecheck=SPIRV): -target spirv-assembly -entry main -stage fragment
4//TEST:CROSS_COMPILE:-target dxbc-assembly  -entry main -stage fragment
5//TEST:CROSS_COMPILE:-target dxil-assembly  -entry main -stage fragment -profile sm_6_0
6
7// Test handling of the `precise` keyword
8
9// SPIRV: OpEntryPoint
10
11float4 main(float2 v : V) : SV_Target
12{
13	precise float z;
14
15	if(v.x > 0)
16	{
17		z = v.x * v.y + v.x;
18	}
19	else
20	{
21		z = v.y * v.x + v.y;
22	}
23
24	return z;
25}