blob: b5ddf49322d6de8a794bdc2764829ff9d7822ebb [file] [log] [blame]
John Kessenichfcc0aa32016-08-24 18:34:43 -06001// function selection under type conversion
John Kesseniche3f2c8f2016-08-25 15:57:56 -06002void foo1(double a, bool b) {}
3void foo1(double a, uint b) {}
4void foo1(double a, int b) {}
5void foo1(double a, float b) {}
John Kessenichfcc0aa32016-08-24 18:34:43 -06006void foo1(double a, double b){}
7
John Kessenich90dd70f2016-08-25 10:49:21 -06008// uint -> int
John Kesseniche3f2c8f2016-08-25 15:57:56 -06009void foo2(int a, bool b) {}
10void foo2(int a, uint b) {}
11void foo2(int a, int b) {}
12void foo2(int a, float b) {}
John Kessenich90dd70f2016-08-25 10:49:21 -060013void foo2(int a, double b){}
14
15// everything can promote
John Kesseniche3f2c8f2016-08-25 15:57:56 -060016void foo3(bool b) {}
17void foo4(uint b) {}
18void foo5(int b) {}
19void foo6(float b) {}
John Kessenich90dd70f2016-08-25 10:49:21 -060020void foo7(double b){}
21
22// shorter forward chain better than longer or backward chain
John Kesseniche3f2c8f2016-08-25 15:57:56 -060023void foo8(float) {}
24void foo8(double) {}
25void foo9(int) {}
26void foo9(uint) {}
27void foo10(bool) {}
28void foo10(int) {}
29
30// shape change is worse
31void foo11(float3) {}
32void foo11(double) {}
33void foo11(int3) {}
34void foo11(uint) {}
35void foo12(float1) {}
36void foo12(double3) {}
37void foo16(uint) {}
38void foo16(uint2) {}
39
40// shape change
41void foo13(float3) {}
42void foo14(int1) {}
43void foo15(bool1) {}
John Kessenich90dd70f2016-08-25 10:49:21 -060044
John Kessenichfcc0aa32016-08-24 18:34:43 -060045float4 PixelShaderFunction(float4 input) : COLOR0
46{
John Kesseniche3f2c8f2016-08-25 15:57:56 -060047 bool b;
48 double d;
49 uint u;
50 int i;
51 float f;
John Kessenichfcc0aa32016-08-24 18:34:43 -060052
John Kesseniche3f2c8f2016-08-25 15:57:56 -060053 foo1(d, b);
54 foo1(d, d);
55 foo1(d, u);
56 foo1(d, i);
57 foo1(d, f);
58
59 foo1(f, b);
60 foo1(f, d);
61 foo1(f, u);
62 foo1(f, i);
63 foo1(f, f);
64
65 foo1(u, b);
66 foo1(u, d);
67 foo1(u, u);
68 foo1(u, i);
69 foo1(u, f);
70
71 foo1(i, b);
72 foo1(i, d);
73 foo1(i, u);
74 foo1(i, i);
75 foo1(i, f);
76
77 foo2(u, b);
78 foo2(u, d);
79 foo2(u, u);
80 foo2(u, i);
81 foo2(u, f);
82
83 foo2(i, b);
84 foo2(i, d);
85 foo2(i, u);
86 foo2(i, i);
87 foo2(i, f);
88
89 foo3(b);
90 foo3(d);
91 foo3(u);
92 foo3(i);
93 foo3(f);
94
95 foo4(b);
96 foo4(d);
97 foo4(u);
98 foo4(i);
99 foo4(f);
100
101 foo5(b);
102 foo5(d);
103 foo5(u);
104 foo5(i);
105 foo5(f);
106
107 foo6(b);
108 foo6(d);
109 foo6(u);
110 foo6(i);
111 foo6(f);
112
113 foo7(b);
114 foo7(d);
115 foo7(u);
116 foo7(i);
117 foo7(f);
118
119 foo8(b);
120 foo8(u);
121 foo8(i);
122
123 foo9(b);
124 foo9(f);
125 foo9(d);
126
127 foo10(u);
128 foo10(f);
129 foo10(d);
130
131 foo11(b);
132 foo11(f);
133 foo12(float3(f));
134 foo16(int2(i,i));
135
136 foo13(f);
137 foo14(int4(i));
138 foo15(b);
139 foo15(bool3(b));
140
John Kessenichfcc0aa32016-08-24 18:34:43 -0600141 return input;
142}