summaryrefslogtreecommitdiffstats
path: root/tests/cross-compile/precise-keyword.slang
blob: 9be605e0c804c3e23d6dcabc18b3d2391fdb2644 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// precise-keyword.slang

//TEST:SIMPLE(filecheck=SPIRV): -target spirv-assembly -entry main -stage fragment
//TEST:CROSS_COMPILE:-target dxbc-assembly  -entry main -stage fragment
//TEST:CROSS_COMPILE:-target dxil-assembly  -entry main -stage fragment -profile sm_6_0

// Test handling of the `precise` keyword

// SPIRV: OpEntryPoint

float4 main(float2 v : V) : SV_Target
{
	precise float z;

	if(v.x > 0)
	{
		z = v.x * v.y + v.x;
	}
	else
	{
		z = v.y * v.x + v.y;
	}

	return z;
}