blob: c77404edbf6fbcf4211231a31d2de73dfcff4187 [file] [log] [blame]
LoopDawg58910702016-06-13 09:22:28 -06001float VertexShaderFunction(float inF0, float inF1, float inF2, uint inU0, uint inU1)
LoopDawg4b677322016-05-26 10:10:16 -06002{
3 all(inF0);
4 abs(inF0);
5 acos(inF0);
6 any(inF0);
7 asin(inF0);
LoopDawg58910702016-06-13 09:22:28 -06008 asint(inF0);
9 asuint(inF0);
10 asfloat(inU0);
11 // asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics
LoopDawg4b677322016-05-26 10:10:16 -060012 atan(inF0);
13 atan2(inF0, inF1);
14 ceil(inF0);
15 clamp(inF0, inF1, inF2);
16 cos(inF0);
17 cosh(inF0);
18 countbits(7);
19 degrees(inF0);
20 // EvaluateAttributeAtCentroid(inF0);
21 // EvaluateAttributeAtSample(inF0, 0);
22 // TODO: EvaluateAttributeSnapped(inF0, int2(1,2));
23 exp(inF0);
24 exp2(inF0);
25 firstbithigh(7);
26 firstbitlow(7);
27 floor(inF0);
28 // TODO: fma(inD0, inD1, inD2);
29 fmod(inF0, inF1);
30 frac(inF0);
31 frexp(inF0, inF1);
LoopDawg4b677322016-05-26 10:10:16 -060032 isinf(inF0);
33 isnan(inF0);
34 ldexp(inF0, inF1);
35 log(inF0);
LoopDawg592860c2016-06-09 08:57:35 -060036 log10(inF0);
LoopDawg4b677322016-05-26 10:10:16 -060037 log2(inF0);
38 max(inF0, inF1);
39 min(inF0, inF1);
40 // TODO: mul(inF0, inF1);
41 pow(inF0, inF1);
42 radians(inF0);
43 reversebits(2);
44 round(inF0);
45 rsqrt(inF0);
LoopDawg592860c2016-06-09 08:57:35 -060046 saturate(inF0);
LoopDawg4b677322016-05-26 10:10:16 -060047 sign(inF0);
48 sin(inF0);
LoopDawg592860c2016-06-09 08:57:35 -060049 sincos(inF0, inF1, inF2);
LoopDawg4b677322016-05-26 10:10:16 -060050 sinh(inF0);
51 smoothstep(inF0, inF1, inF2);
52 sqrt(inF0);
53 step(inF0, inF1);
54 tan(inF0);
55 tanh(inF0);
56 // TODO: sampler intrinsics, when we can declare the types.
57 trunc(inF0);
58
59 return 0.0;
60}
61
62float1 VertexShaderFunction(float1 inF0, float1 inF1, float1 inF2)
63{
64 // TODO: ... add when float1 prototypes are generated
65 return 0.0;
66}
67
LoopDawg58910702016-06-13 09:22:28 -060068float2 VertexShaderFunction(float2 inF0, float2 inF1, float2 inF2, uint2 inU0, uint2 inU1)
LoopDawg4b677322016-05-26 10:10:16 -060069{
70 all(inF0);
71 abs(inF0);
72 acos(inF0);
73 any(inF0);
74 asin(inF0);
LoopDawg58910702016-06-13 09:22:28 -060075 asint(inF0);
76 asuint(inF0);
77 asfloat(inU0);
78 // asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics
LoopDawg4b677322016-05-26 10:10:16 -060079 atan(inF0);
80 atan2(inF0, inF1);
81 ceil(inF0);
82 clamp(inF0, inF1, inF2);
83 cos(inF0);
84 cosh(inF0);
85 countbits(int2(7,3));
86 degrees(inF0);
87 distance(inF0, inF1);
88 dot(inF0, inF1);
89 // EvaluateAttributeAtCentroid(inF0);
90 // EvaluateAttributeAtSample(inF0, 0);
91 // TODO: EvaluateAttributeSnapped(inF0, int2(1,2));
92 exp(inF0);
93 exp2(inF0);
94 faceforward(inF0, inF1, inF2);
95 firstbithigh(7);
96 firstbitlow(7);
97 floor(inF0);
98 // TODO: fma(inD0, inD1, inD2);
99 fmod(inF0, inF1);
100 frac(inF0);
101 frexp(inF0, inF1);
LoopDawg4b677322016-05-26 10:10:16 -0600102 isinf(inF0);
103 isnan(inF0);
104 ldexp(inF0, inF1);
105 length(inF0);
106 log(inF0);
LoopDawg592860c2016-06-09 08:57:35 -0600107 log10(inF0);
LoopDawg4b677322016-05-26 10:10:16 -0600108 log2(inF0);
109 max(inF0, inF1);
110 min(inF0, inF1);
111 // TODO: mul(inF0, inF1);
112 normalize(inF0);
113 pow(inF0, inF1);
114 radians(inF0);
115 reflect(inF0, inF1);
116 refract(inF0, inF1, 2.0);
117 reversebits(int2(1,2));
118 round(inF0);
119 rsqrt(inF0);
LoopDawg592860c2016-06-09 08:57:35 -0600120 saturate(inF0);
LoopDawg4b677322016-05-26 10:10:16 -0600121 sign(inF0);
122 sin(inF0);
LoopDawg592860c2016-06-09 08:57:35 -0600123 sincos(inF0, inF1, inF2);
LoopDawg4b677322016-05-26 10:10:16 -0600124 sinh(inF0);
125 smoothstep(inF0, inF1, inF2);
126 sqrt(inF0);
127 step(inF0, inF1);
128 tan(inF0);
129 tanh(inF0);
130 // TODO: sampler intrinsics, when we can declare the types.
131 trunc(inF0);
132
133 // TODO: ... add when float1 prototypes are generated
134 return float2(1,2);
135}
136
LoopDawg58910702016-06-13 09:22:28 -0600137float3 VertexShaderFunction(float3 inF0, float3 inF1, float3 inF2, uint3 inU0, uint3 inU1)
LoopDawg4b677322016-05-26 10:10:16 -0600138{
139 all(inF0);
140 abs(inF0);
141 acos(inF0);
142 any(inF0);
143 asin(inF0);
LoopDawg58910702016-06-13 09:22:28 -0600144 asint(inF0);
145 asuint(inF0);
146 asfloat(inU0);
147 // asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics
LoopDawg4b677322016-05-26 10:10:16 -0600148 atan(inF0);
149 atan2(inF0, inF1);
150 ceil(inF0);
151 clamp(inF0, inF1, inF2);
152 cos(inF0);
153 cosh(inF0);
154 countbits(int3(7,3,5));
155 cross(inF0, inF1);
156 degrees(inF0);
157 distance(inF0, inF1);
158 dot(inF0, inF1);
159 // EvaluateAttributeAtCentroid(inF0);
160 // EvaluateAttributeAtSample(inF0, 0);
161 // TODO: EvaluateAttributeSnapped(inF0, int2(1,2));
162 exp(inF0);
163 exp2(inF0);
164 faceforward(inF0, inF1, inF2);
165 firstbithigh(7);
166 firstbitlow(7);
167 floor(inF0);
168 // TODO: fma(inD0, inD1, inD2);
169 fmod(inF0, inF1);
170 frac(inF0);
171 frexp(inF0, inF1);
LoopDawg4b677322016-05-26 10:10:16 -0600172 isinf(inF0);
173 isnan(inF0);
174 ldexp(inF0, inF1);
175 length(inF0);
176 log(inF0);
LoopDawg592860c2016-06-09 08:57:35 -0600177 log10(inF0);
LoopDawg4b677322016-05-26 10:10:16 -0600178 log2(inF0);
179 max(inF0, inF1);
180 min(inF0, inF1);
181 // TODO: mul(inF0, inF1);
182 normalize(inF0);
183 pow(inF0, inF1);
184 radians(inF0);
185 reflect(inF0, inF1);
186 refract(inF0, inF1, 2.0);
187 reversebits(int3(1,2,3));
188 round(inF0);
189 rsqrt(inF0);
LoopDawg592860c2016-06-09 08:57:35 -0600190 saturate(inF0);
LoopDawg4b677322016-05-26 10:10:16 -0600191 sign(inF0);
192 sin(inF0);
LoopDawg592860c2016-06-09 08:57:35 -0600193 sincos(inF0, inF1, inF2);
LoopDawg4b677322016-05-26 10:10:16 -0600194 sinh(inF0);
195 smoothstep(inF0, inF1, inF2);
196 sqrt(inF0);
197 step(inF0, inF1);
198 tan(inF0);
199 tanh(inF0);
200 // TODO: sampler intrinsics, when we can declare the types.
201 trunc(inF0);
202
203 // TODO: ... add when float1 prototypes are generated
204 return float3(1,2,3);
205}
206
LoopDawg58910702016-06-13 09:22:28 -0600207float4 VertexShaderFunction(float4 inF0, float4 inF1, float4 inF2, uint4 inU0, uint4 inU1)
LoopDawg4b677322016-05-26 10:10:16 -0600208{
209 all(inF0);
210 abs(inF0);
211 acos(inF0);
212 any(inF0);
213 asin(inF0);
LoopDawg58910702016-06-13 09:22:28 -0600214 asint(inF0);
215 asuint(inF0);
216 asfloat(inU0);
217 // asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics
LoopDawg4b677322016-05-26 10:10:16 -0600218 atan(inF0);
219 atan2(inF0, inF1);
220 ceil(inF0);
221 clamp(inF0, inF1, inF2);
222 cos(inF0);
223 cosh(inF0);
224 countbits(int4(7,3,5,2));
225 degrees(inF0);
226 distance(inF0, inF1);
227 dot(inF0, inF1);
LoopDawg592860c2016-06-09 08:57:35 -0600228 dst(inF0, inF1);
LoopDawg4b677322016-05-26 10:10:16 -0600229 // EvaluateAttributeAtCentroid(inF0);
230 // EvaluateAttributeAtSample(inF0, 0);
231 // TODO: EvaluateAttributeSnapped(inF0, int2(1,2));
232 exp(inF0);
233 exp2(inF0);
234 faceforward(inF0, inF1, inF2);
235 firstbithigh(7);
236 firstbitlow(7);
237 floor(inF0);
238 // TODO: fma(inD0, inD1, inD2);
239 fmod(inF0, inF1);
240 frac(inF0);
241 frexp(inF0, inF1);
LoopDawg4b677322016-05-26 10:10:16 -0600242 isinf(inF0);
243 isnan(inF0);
244 ldexp(inF0, inF1);
245 length(inF0);
246 log(inF0);
LoopDawg592860c2016-06-09 08:57:35 -0600247 log10(inF0);
LoopDawg4b677322016-05-26 10:10:16 -0600248 log2(inF0);
249 max(inF0, inF1);
250 min(inF0, inF1);
251 // TODO: mul(inF0, inF1);
252 normalize(inF0);
253 pow(inF0, inF1);
254 radians(inF0);
255 reflect(inF0, inF1);
256 refract(inF0, inF1, 2.0);
257 reversebits(int4(1,2,3,4));
258 round(inF0);
259 rsqrt(inF0);
LoopDawg592860c2016-06-09 08:57:35 -0600260 saturate(inF0);
LoopDawg4b677322016-05-26 10:10:16 -0600261 sign(inF0);
262 sin(inF0);
LoopDawg592860c2016-06-09 08:57:35 -0600263 sincos(inF0, inF1, inF2);
LoopDawg4b677322016-05-26 10:10:16 -0600264 sinh(inF0);
265 smoothstep(inF0, inF1, inF2);
266 sqrt(inF0);
267 step(inF0, inF1);
268 tan(inF0);
269 tanh(inF0);
270 // TODO: sampler intrinsics, when we can declare the types.
271 trunc(inF0);
272
273 // TODO: ... add when float1 prototypes are generated
274 return float4(1,2,3,4);
275}
276
LoopDawg58910702016-06-13 09:22:28 -0600277// TODO: for mats:
278// asfloat(inU0); \
279// asint(inF0); \
280// asuint(inF0); \
281
LoopDawg4b677322016-05-26 10:10:16 -0600282// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
283#define MATFNS() \
284 all(inF0); \
285 abs(inF0); \
286 acos(inF0); \
287 any(inF0); \
288 asin(inF0); \
289 atan(inF0); \
290 atan2(inF0, inF1); \
291 ceil(inF0); \
292 clamp(inF0, inF1, inF2); \
293 cos(inF0); \
294 cosh(inF0); \
295 degrees(inF0); \
296 determinant(inF0); \
297 exp(inF0); \
298 exp2(inF0); \
299 firstbithigh(7); \
300 firstbitlow(7); \
301 floor(inF0); \
302 fmod(inF0, inF1); \
303 frac(inF0); \
304 frexp(inF0, inF1); \
LoopDawg4b677322016-05-26 10:10:16 -0600305 ldexp(inF0, inF1); \
306 log(inF0); \
LoopDawg592860c2016-06-09 08:57:35 -0600307 log10(inF0); \
LoopDawg4b677322016-05-26 10:10:16 -0600308 log2(inF0); \
309 max(inF0, inF1); \
310 min(inF0, inF1); \
311 pow(inF0, inF1); \
312 radians(inF0); \
313 round(inF0); \
314 rsqrt(inF0); \
LoopDawg592860c2016-06-09 08:57:35 -0600315 saturate(inF0); \
LoopDawg4b677322016-05-26 10:10:16 -0600316 sign(inF0); \
317 sin(inF0); \
LoopDawg592860c2016-06-09 08:57:35 -0600318 sincos(inF0, inF1, inF2); \
LoopDawg4b677322016-05-26 10:10:16 -0600319 sinh(inF0); \
320 smoothstep(inF0, inF1, inF2); \
321 sqrt(inF0); \
322 step(inF0, inF1); \
323 tan(inF0); \
324 tanh(inF0); \
325 transpose(inF0); \
326 trunc(inF0);
327
328// TODO: turn on non-square matrix tests when protos are available.
329
330float2x2 VertexShaderFunction(float2x2 inF0, float2x2 inF1, float2x2 inF2)
331{
332 // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
LoopDawgef764a22016-06-03 09:17:51 -0600333 MATFNS();
LoopDawg4b677322016-05-26 10:10:16 -0600334
335 // TODO: ... add when float1 prototypes are generated
336 return float2x2(2,2,2,2);
337}
338
339float3x3 VertexShaderFunction(float3x3 inF0, float3x3 inF1, float3x3 inF2)
340{
341 // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
LoopDawgef764a22016-06-03 09:17:51 -0600342 MATFNS();
LoopDawg4b677322016-05-26 10:10:16 -0600343
344 // TODO: ... add when float1 prototypes are generated
345 return float3x3(3,3,3,3,3,3,3,3,3);
346}
347
348float4x4 VertexShaderFunction(float4x4 inF0, float4x4 inF1, float4x4 inF2)
349{
350 // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
LoopDawgef764a22016-06-03 09:17:51 -0600351 MATFNS();
LoopDawg4b677322016-05-26 10:10:16 -0600352
353 // TODO: ... add when float1 prototypes are generated
354 return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4);
355}
LoopDawg592860c2016-06-09 08:57:35 -0600356
357#define TESTGENMUL(ST, VT, MT) \
358 ST r0 = mul(inF0, inF1); \
359 VT r1 = mul(inFV0, inF0); \
360 VT r2 = mul(inF0, inFV0); \
361 ST r3 = mul(inFV0, inFV1); \
362 VT r4 = mul(inFM0, inFV0); \
363 VT r5 = mul(inFV0, inFM0); \
364 MT r6 = mul(inFM0, inF0); \
365 MT r7 = mul(inF0, inFM0); \
366 MT r8 = mul(inFM0, inFM1);
367
368
369void TestGenMul(float inF0, float inF1,
370 float2 inFV0, float2 inFV1,
371 float2x2 inFM0, float2x2 inFM1)
372{
373 TESTGENMUL(float, float2, float2x2);
374}
375
376void TestGenMul(float inF0, float inF1,
377 float3 inFV0, float3 inFV1,
378 float3x3 inFM0, float3x3 inFM1)
379{
380 TESTGENMUL(float, float3, float3x3);
381}
382
383void TestGenMul(float inF0, float inF1,
384 float4 inFV0, float4 inFV1,
385 float4x4 inFM0, float4x4 inFM1)
386{
387 TESTGENMUL(float, float4, float4x4);
388}