blob: cab79a83490cf0bf0af7d07103eb306c05851312 [file] [log] [blame]
LoopDawg4b677322016-05-26 10:10:16 -06001float VertexShaderFunction(float inF0, float inF1, float inF2)
2{
3 all(inF0);
4 abs(inF0);
5 acos(inF0);
6 any(inF0);
7 asin(inF0);
8 atan(inF0);
9 atan2(inF0, inF1);
10 ceil(inF0);
11 clamp(inF0, inF1, inF2);
12 cos(inF0);
13 cosh(inF0);
14 countbits(7);
15 degrees(inF0);
16 // EvaluateAttributeAtCentroid(inF0);
17 // EvaluateAttributeAtSample(inF0, 0);
18 // TODO: EvaluateAttributeSnapped(inF0, int2(1,2));
19 exp(inF0);
20 exp2(inF0);
21 firstbithigh(7);
22 firstbitlow(7);
23 floor(inF0);
24 // TODO: fma(inD0, inD1, inD2);
25 fmod(inF0, inF1);
26 frac(inF0);
27 frexp(inF0, inF1);
28 fwidth(inF0);
29 isinf(inF0);
30 isnan(inF0);
31 ldexp(inF0, inF1);
32 log(inF0);
LoopDawg592860c2016-06-09 08:57:35 -060033 log10(inF0);
LoopDawg4b677322016-05-26 10:10:16 -060034 log2(inF0);
35 max(inF0, inF1);
36 min(inF0, inF1);
37 // TODO: mul(inF0, inF1);
38 pow(inF0, inF1);
39 radians(inF0);
40 reversebits(2);
41 round(inF0);
42 rsqrt(inF0);
LoopDawg592860c2016-06-09 08:57:35 -060043 saturate(inF0);
LoopDawg4b677322016-05-26 10:10:16 -060044 sign(inF0);
45 sin(inF0);
LoopDawg592860c2016-06-09 08:57:35 -060046 sincos(inF0, inF1, inF2);
LoopDawg4b677322016-05-26 10:10:16 -060047 sinh(inF0);
48 smoothstep(inF0, inF1, inF2);
49 sqrt(inF0);
50 step(inF0, inF1);
51 tan(inF0);
52 tanh(inF0);
53 // TODO: sampler intrinsics, when we can declare the types.
54 trunc(inF0);
55
56 return 0.0;
57}
58
59float1 VertexShaderFunction(float1 inF0, float1 inF1, float1 inF2)
60{
61 // TODO: ... add when float1 prototypes are generated
62 return 0.0;
63}
64
65float2 VertexShaderFunction(float2 inF0, float2 inF1, float2 inF2)
66{
67 all(inF0);
68 abs(inF0);
69 acos(inF0);
70 any(inF0);
71 asin(inF0);
72 atan(inF0);
73 atan2(inF0, inF1);
74 ceil(inF0);
75 clamp(inF0, inF1, inF2);
76 cos(inF0);
77 cosh(inF0);
78 countbits(int2(7,3));
79 degrees(inF0);
80 distance(inF0, inF1);
81 dot(inF0, inF1);
82 // EvaluateAttributeAtCentroid(inF0);
83 // EvaluateAttributeAtSample(inF0, 0);
84 // TODO: EvaluateAttributeSnapped(inF0, int2(1,2));
85 exp(inF0);
86 exp2(inF0);
87 faceforward(inF0, inF1, inF2);
88 firstbithigh(7);
89 firstbitlow(7);
90 floor(inF0);
91 // TODO: fma(inD0, inD1, inD2);
92 fmod(inF0, inF1);
93 frac(inF0);
94 frexp(inF0, inF1);
95 fwidth(inF0);
96 isinf(inF0);
97 isnan(inF0);
98 ldexp(inF0, inF1);
99 length(inF0);
100 log(inF0);
LoopDawg592860c2016-06-09 08:57:35 -0600101 log10(inF0);
LoopDawg4b677322016-05-26 10:10:16 -0600102 log2(inF0);
103 max(inF0, inF1);
104 min(inF0, inF1);
105 // TODO: mul(inF0, inF1);
106 normalize(inF0);
107 pow(inF0, inF1);
108 radians(inF0);
109 reflect(inF0, inF1);
110 refract(inF0, inF1, 2.0);
111 reversebits(int2(1,2));
112 round(inF0);
113 rsqrt(inF0);
LoopDawg592860c2016-06-09 08:57:35 -0600114 saturate(inF0);
LoopDawg4b677322016-05-26 10:10:16 -0600115 sign(inF0);
116 sin(inF0);
LoopDawg592860c2016-06-09 08:57:35 -0600117 sincos(inF0, inF1, inF2);
LoopDawg4b677322016-05-26 10:10:16 -0600118 sinh(inF0);
119 smoothstep(inF0, inF1, inF2);
120 sqrt(inF0);
121 step(inF0, inF1);
122 tan(inF0);
123 tanh(inF0);
124 // TODO: sampler intrinsics, when we can declare the types.
125 trunc(inF0);
126
127 // TODO: ... add when float1 prototypes are generated
128 return float2(1,2);
129}
130
131float3 VertexShaderFunction(float3 inF0, float3 inF1, float3 inF2)
132{
133 all(inF0);
134 abs(inF0);
135 acos(inF0);
136 any(inF0);
137 asin(inF0);
138 atan(inF0);
139 atan2(inF0, inF1);
140 ceil(inF0);
141 clamp(inF0, inF1, inF2);
142 cos(inF0);
143 cosh(inF0);
144 countbits(int3(7,3,5));
145 cross(inF0, inF1);
146 degrees(inF0);
147 distance(inF0, inF1);
148 dot(inF0, inF1);
149 // EvaluateAttributeAtCentroid(inF0);
150 // EvaluateAttributeAtSample(inF0, 0);
151 // TODO: EvaluateAttributeSnapped(inF0, int2(1,2));
152 exp(inF0);
153 exp2(inF0);
154 faceforward(inF0, inF1, inF2);
155 firstbithigh(7);
156 firstbitlow(7);
157 floor(inF0);
158 // TODO: fma(inD0, inD1, inD2);
159 fmod(inF0, inF1);
160 frac(inF0);
161 frexp(inF0, inF1);
162 fwidth(inF0);
163 isinf(inF0);
164 isnan(inF0);
165 ldexp(inF0, inF1);
166 length(inF0);
167 log(inF0);
LoopDawg592860c2016-06-09 08:57:35 -0600168 log10(inF0);
LoopDawg4b677322016-05-26 10:10:16 -0600169 log2(inF0);
170 max(inF0, inF1);
171 min(inF0, inF1);
172 // TODO: mul(inF0, inF1);
173 normalize(inF0);
174 pow(inF0, inF1);
175 radians(inF0);
176 reflect(inF0, inF1);
177 refract(inF0, inF1, 2.0);
178 reversebits(int3(1,2,3));
179 round(inF0);
180 rsqrt(inF0);
LoopDawg592860c2016-06-09 08:57:35 -0600181 saturate(inF0);
LoopDawg4b677322016-05-26 10:10:16 -0600182 sign(inF0);
183 sin(inF0);
LoopDawg592860c2016-06-09 08:57:35 -0600184 sincos(inF0, inF1, inF2);
LoopDawg4b677322016-05-26 10:10:16 -0600185 sinh(inF0);
186 smoothstep(inF0, inF1, inF2);
187 sqrt(inF0);
188 step(inF0, inF1);
189 tan(inF0);
190 tanh(inF0);
191 // TODO: sampler intrinsics, when we can declare the types.
192 trunc(inF0);
193
194 // TODO: ... add when float1 prototypes are generated
195 return float3(1,2,3);
196}
197
198float4 VertexShaderFunction(float4 inF0, float4 inF1, float4 inF2)
199{
200 all(inF0);
201 abs(inF0);
202 acos(inF0);
203 any(inF0);
204 asin(inF0);
205 atan(inF0);
206 atan2(inF0, inF1);
207 ceil(inF0);
208 clamp(inF0, inF1, inF2);
209 cos(inF0);
210 cosh(inF0);
211 countbits(int4(7,3,5,2));
212 degrees(inF0);
213 distance(inF0, inF1);
214 dot(inF0, inF1);
LoopDawg592860c2016-06-09 08:57:35 -0600215 dst(inF0, inF1);
LoopDawg4b677322016-05-26 10:10:16 -0600216 // EvaluateAttributeAtCentroid(inF0);
217 // EvaluateAttributeAtSample(inF0, 0);
218 // TODO: EvaluateAttributeSnapped(inF0, int2(1,2));
219 exp(inF0);
220 exp2(inF0);
221 faceforward(inF0, inF1, inF2);
222 firstbithigh(7);
223 firstbitlow(7);
224 floor(inF0);
225 // TODO: fma(inD0, inD1, inD2);
226 fmod(inF0, inF1);
227 frac(inF0);
228 frexp(inF0, inF1);
229 fwidth(inF0);
230 isinf(inF0);
231 isnan(inF0);
232 ldexp(inF0, inF1);
233 length(inF0);
234 log(inF0);
LoopDawg592860c2016-06-09 08:57:35 -0600235 log10(inF0);
LoopDawg4b677322016-05-26 10:10:16 -0600236 log2(inF0);
237 max(inF0, inF1);
238 min(inF0, inF1);
239 // TODO: mul(inF0, inF1);
240 normalize(inF0);
241 pow(inF0, inF1);
242 radians(inF0);
243 reflect(inF0, inF1);
244 refract(inF0, inF1, 2.0);
245 reversebits(int4(1,2,3,4));
246 round(inF0);
247 rsqrt(inF0);
LoopDawg592860c2016-06-09 08:57:35 -0600248 saturate(inF0);
LoopDawg4b677322016-05-26 10:10:16 -0600249 sign(inF0);
250 sin(inF0);
LoopDawg592860c2016-06-09 08:57:35 -0600251 sincos(inF0, inF1, inF2);
LoopDawg4b677322016-05-26 10:10:16 -0600252 sinh(inF0);
253 smoothstep(inF0, inF1, inF2);
254 sqrt(inF0);
255 step(inF0, inF1);
256 tan(inF0);
257 tanh(inF0);
258 // TODO: sampler intrinsics, when we can declare the types.
259 trunc(inF0);
260
261 // TODO: ... add when float1 prototypes are generated
262 return float4(1,2,3,4);
263}
264
265// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
266#define MATFNS() \
267 all(inF0); \
268 abs(inF0); \
269 acos(inF0); \
270 any(inF0); \
271 asin(inF0); \
272 atan(inF0); \
273 atan2(inF0, inF1); \
274 ceil(inF0); \
275 clamp(inF0, inF1, inF2); \
276 cos(inF0); \
277 cosh(inF0); \
278 degrees(inF0); \
279 determinant(inF0); \
280 exp(inF0); \
281 exp2(inF0); \
282 firstbithigh(7); \
283 firstbitlow(7); \
284 floor(inF0); \
285 fmod(inF0, inF1); \
286 frac(inF0); \
287 frexp(inF0, inF1); \
288 fwidth(inF0); \
289 ldexp(inF0, inF1); \
290 log(inF0); \
LoopDawg592860c2016-06-09 08:57:35 -0600291 log10(inF0); \
LoopDawg4b677322016-05-26 10:10:16 -0600292 log2(inF0); \
293 max(inF0, inF1); \
294 min(inF0, inF1); \
295 pow(inF0, inF1); \
296 radians(inF0); \
297 round(inF0); \
298 rsqrt(inF0); \
LoopDawg592860c2016-06-09 08:57:35 -0600299 saturate(inF0); \
LoopDawg4b677322016-05-26 10:10:16 -0600300 sign(inF0); \
301 sin(inF0); \
LoopDawg592860c2016-06-09 08:57:35 -0600302 sincos(inF0, inF1, inF2); \
LoopDawg4b677322016-05-26 10:10:16 -0600303 sinh(inF0); \
304 smoothstep(inF0, inF1, inF2); \
305 sqrt(inF0); \
306 step(inF0, inF1); \
307 tan(inF0); \
308 tanh(inF0); \
309 transpose(inF0); \
310 trunc(inF0);
311
312// TODO: turn on non-square matrix tests when protos are available.
313
314float2x2 VertexShaderFunction(float2x2 inF0, float2x2 inF1, float2x2 inF2)
315{
316 // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
LoopDawgef764a22016-06-03 09:17:51 -0600317 MATFNS();
LoopDawg4b677322016-05-26 10:10:16 -0600318
319 // TODO: ... add when float1 prototypes are generated
320 return float2x2(2,2,2,2);
321}
322
323float3x3 VertexShaderFunction(float3x3 inF0, float3x3 inF1, float3x3 inF2)
324{
325 // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
LoopDawgef764a22016-06-03 09:17:51 -0600326 MATFNS();
LoopDawg4b677322016-05-26 10:10:16 -0600327
328 // TODO: ... add when float1 prototypes are generated
329 return float3x3(3,3,3,3,3,3,3,3,3);
330}
331
332float4x4 VertexShaderFunction(float4x4 inF0, float4x4 inF1, float4x4 inF2)
333{
334 // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
LoopDawgef764a22016-06-03 09:17:51 -0600335 MATFNS();
LoopDawg4b677322016-05-26 10:10:16 -0600336
337 // TODO: ... add when float1 prototypes are generated
338 return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4);
339}
LoopDawg592860c2016-06-09 08:57:35 -0600340
341#define TESTGENMUL(ST, VT, MT) \
342 ST r0 = mul(inF0, inF1); \
343 VT r1 = mul(inFV0, inF0); \
344 VT r2 = mul(inF0, inFV0); \
345 ST r3 = mul(inFV0, inFV1); \
346 VT r4 = mul(inFM0, inFV0); \
347 VT r5 = mul(inFV0, inFM0); \
348 MT r6 = mul(inFM0, inF0); \
349 MT r7 = mul(inF0, inFM0); \
350 MT r8 = mul(inFM0, inFM1);
351
352
353void TestGenMul(float inF0, float inF1,
354 float2 inFV0, float2 inFV1,
355 float2x2 inFM0, float2x2 inFM1)
356{
357 TESTGENMUL(float, float2, float2x2);
358}
359
360void TestGenMul(float inF0, float inF1,
361 float3 inFV0, float3 inFV1,
362 float3x3 inFM0, float3x3 inFM1)
363{
364 TESTGENMUL(float, float3, float3x3);
365}
366
367void TestGenMul(float inF0, float inF1,
368 float4 inFV0, float4 inFV1,
369 float4x4 inFM0, float4x4 inFM1)
370{
371 TESTGENMUL(float, float4, float4x4);
372}