blob: a5030cf1b560dad39ec79c623597f82562b402f2 [file] [log] [blame]
LoopDawg58910702016-06-13 09:22:28 -06001uint gs_ua;
2uint gs_ub;
3uint gs_uc;
4uint2 gs_ua2;
5uint2 gs_ub2;
6uint2 gs_uc2;
7uint3 gs_ua3;
8uint3 gs_ub3;
9uint3 gs_uc3;
10uint4 gs_ua4;
11uint4 gs_ub4;
12uint4 gs_uc4;
13
LoopDawge903ab52016-06-30 14:13:03 -060014float VertexShaderFunctionS(float inF0, float inF1, float inF2, int inI0)
LoopDawg643fcb52016-06-03 10:53:28 -060015{
LoopDawg58910702016-06-13 09:22:28 -060016 uint out_u1;
17
LoopDawg6e72fdd2016-06-15 09:50:24 -060018 AllMemoryBarrier(); // expected error: only valid in compute stage
19 AllMemoryBarrierWithGroupSync(); // expected error: only valid in compute stage
LoopDawg643fcb52016-06-03 10:53:28 -060020 asdouble(inF0, inF1); // expected error: only integer inputs
21 CheckAccessFullyMapped(3.0); // expected error: only valid on integers
22 CheckAccessFullyMapped(3); // expected error: only valid in pixel & compute stages
LoopDawg58910702016-06-13 09:22:28 -060023 clip(inF0); // expected error: only valid in pixel stage
LoopDawg643fcb52016-06-03 10:53:28 -060024 countbits(inF0); // expected error: only integer inputs
25 cross(inF0, inF1); // expected error: only on float3 inputs
26 D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs
LoopDawg6e72fdd2016-06-15 09:50:24 -060027 DeviceMemoryBarrier(); // expected error: only valid in pixel & compute stages
28 DeviceMemoryBarrierWithGroupSync(); // expected error: only valid in compute stage
LoopDawg58910702016-06-13 09:22:28 -060029 ddx(inF0); // expected error: only valid in pixel stage
30 ddx_coarse(inF0); // expected error: only valid in pixel stage
31 ddx_fine(inF0); // expected error: only valid in pixel stage
32 ddy(inF0); // expected error: only valid in pixel stage
33 ddy_coarse(inF0); // expected error: only valid in pixel stage
34 ddy_fine(inF0); // expected error: only valid in pixel stage
LoopDawg643fcb52016-06-03 10:53:28 -060035 determinant(inF0); // expected error: only valid on mats
36 EvaluateAttributeAtCentroid(inF0); // expected error: only valid in pixel stage
37 EvaluateAttributeAtSample(inF0, 2); // expected error: only valid in pixel stage
38 EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only valid in pixel stage
39 f16tof32(inF0); // expected error: only integer inputs
40 firstbithigh(inF0); // expected error: only integer inputs
41 firstbitlow(inF0); // expected error: only integer inputs
LoopDawg1b7fd0f2016-06-22 15:20:14 -060042 // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
LoopDawg58910702016-06-13 09:22:28 -060043 fwidth(inF0); // expected error: only valid in pixel stage
44 InterlockedAdd(gs_ua, gs_ub); // expected error: only valid in pixel stage
45 InterlockedAdd(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage
46 InterlockedAnd(gs_ua, gs_ub); // expected error: only valid in pixel stage
47 InterlockedAnd(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage
48 InterlockedCompareExchange(gs_ua, gs_ub, gs_uc, out_u1); // expected error: only valid in pixel stage
49 InterlockedExchange(gs_ua, gs_ub, out_u1);// expected error: only valid in pixel stage
50 InterlockedMax(gs_ua, gs_ub); // expected error: only valid in pixel stage
51 InterlockedMax(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage
52 InterlockedMin(gs_ua, gs_ub); // expected error: only valid in pixel stage
53 InterlockedMin(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage
54 InterlockedOr(gs_ua, gs_ub); // expected error: only valid in pixel stage
55 InterlockedOr(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage
56 InterlockedXor(gs_ua, gs_ub); // expected error: only valid in pixel stage
57 InterlockedXor(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage
LoopDawg6e72fdd2016-06-15 09:50:24 -060058 GroupMemoryBarrier(); // expected error: only valid in compute stage
59 GroupMemoryBarrierWithGroupSync(); // expected error: only valid in compute stage
LoopDawg643fcb52016-06-03 10:53:28 -060060 length(inF0); // expect error: invalid on scalars
61 msad4(inF0, float2(0), float4(0)); // expected error: only integer inputs
62 normalize(inF0); // expect error: invalid on scalars
63 reflect(inF0, inF1); // expect error: invalid on scalars
64 refract(inF0, inF1, inF2); // expect error: invalid on scalars
65 refract(float2(0), float2(0), float2(0)); // expected error: last parameter only scalar
66 reversebits(inF0); // expected error: only integer inputs
67 transpose(inF0); // expect error: only valid on mats
68
69 // TODO: texture intrinsics, when we can declare samplers.
70
71 return 0.0;
72}
73
LoopDawge903ab52016-06-30 14:13:03 -060074float1 VertexShaderFunction1(float1 inF0, float1 inF1, float1 inF2, int1 inI0)
LoopDawg643fcb52016-06-03 10:53:28 -060075{
76 // TODO: ... add when float1 prototypes are generated
77
78 GetRenderTargetSamplePosition(inF0); // expected error: only integer inputs
79
80 return 0.0;
81}
82
LoopDawge903ab52016-06-30 14:13:03 -060083float2 VertexShaderFunction2(float2 inF0, float2 inF1, float2 inF2, int2 inI0)
LoopDawg643fcb52016-06-03 10:53:28 -060084{
LoopDawg58910702016-06-13 09:22:28 -060085 uint2 out_u2;
86
87 asdouble(inF0, inF1); // expected error: only integer inputs
88 CheckAccessFullyMapped(inF0); // expect error: only valid on scalars
89 countbits(inF0); // expected error: only integer inputs
90 cross(inF0, inF1); // expected error: only on float3 inputs
91 D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs
92 ddx(inF0); // only valid in pixel stage
93 ddx_coarse(inF0); // only valid in pixel stage
94 ddx_fine(inF0); // only valid in pixel stage
95 ddy(inF0); // only valid in pixel stage
96 ddy_coarse(inF0); // only valid in pixel stage
97 ddy_fine(inF0); // only valid in pixel stage
98 determinant(inF0); // expect error: only valid on mats
99 EvaluateAttributeAtCentroid(inF0); // expected error: only valid in pixel stage
100 EvaluateAttributeAtSample(inF0, 2); // expected error: only valid in pixel stage
101 EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only valid in pixel stage
102 f16tof32(inF0); // expected error: only integer inputs
103 firstbithigh(inF0); // expected error: only integer inputs
104 firstbitlow(inF0); // expected error: only integer inputs
LoopDawg1b7fd0f2016-06-22 15:20:14 -0600105 // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
LoopDawg58910702016-06-13 09:22:28 -0600106 fwidth(inF0); // expected error: only valid in pixel stage
107 InterlockedAdd(gs_ua2, gs_ub2); // expected error: only valid in pixel stage
108 InterlockedAdd(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage
109 InterlockedAnd(gs_ua2, gs_ub2); // expected error: only valid in pixel stage
110 InterlockedAnd(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage
111 InterlockedCompareExchange(gs_ua2, gs_ub2, gs_uc2, out_u2); // expected error: only valid in pixel stage
112 InterlockedExchange(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage
113 InterlockedMax(gs_ua2, gs_ub2); // expected error: only valid in pixel stage
114 InterlockedMax(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage
115 InterlockedMin(gs_ua2, gs_ub2); // expected error: only valid in pixel stage
116 InterlockedMin(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage
117 InterlockedOr(gs_ua2, gs_ub2); // expected error: only valid in pixel stage
118 InterlockedOr(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage
119 InterlockedXor(gs_ua2, gs_ub2); // expected error: only valid in pixel stage
120 InterlockedXor(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage
121 noise(inF0); // expected error: only valid in pixel stage
122 reversebits(inF0); // expected error: only integer inputs
123 transpose(inF0); // expect error: only valid on mats
LoopDawg643fcb52016-06-03 10:53:28 -0600124
125 // TODO: texture intrinsics, when we can declare samplers.
126
127 return float2(1,2);
128}
129
LoopDawge903ab52016-06-30 14:13:03 -0600130float3 VertexShaderFunction3(float3 inF0, float3 inF1, float3 inF2, int3 inI0)
LoopDawg643fcb52016-06-03 10:53:28 -0600131{
LoopDawg58910702016-06-13 09:22:28 -0600132 uint3 out_u3;
133
134 CheckAccessFullyMapped(inF0); // expect error: only valid on scalars
135 countbits(inF0); // expected error: only integer inputs
136 ddx(inF0); // only valid in pixel stage
137 ddx_coarse(inF0); // only valid in pixel stage
138 ddx_fine(inF0); // only valid in pixel stage
139 ddy(inF0); // only valid in pixel stage
140 ddy_coarse(inF0); // only valid in pixel stage
141 ddy_fine(inF0); // only valid in pixel stage
142 D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs
143 determinant(inF0); // expect error: only valid on mats
144 EvaluateAttributeAtCentroid(inF0); // expected error: only valid in pixel stage
145 EvaluateAttributeAtSample(inF0, 2); // expected error: only valid in pixel stage
146 EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only valid in pixel stage
147 f16tof32(inF0); // expected error: only integer inputs
148 firstbithigh(inF0); // expected error: only integer inputs
149 firstbitlow(inF0); // expected error: only integer inputs
LoopDawg1b7fd0f2016-06-22 15:20:14 -0600150 // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
LoopDawg58910702016-06-13 09:22:28 -0600151 fwidth(inF0); // expected error: only valid in pixel stage
152 InterlockedAdd(gs_ua3, gs_ub3); // expected error: only valid in pixel stage
153 InterlockedAdd(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage
154 InterlockedAnd(gs_ua3, gs_ub3); // expected error: only valid in pixel stage
155 InterlockedAnd(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage
156 InterlockedCompareExchange(gs_ua3, gs_ub3, gs_uc3, out_u3); // expected error: only valid in pixel stage
157 InterlockedExchange(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage
158 InterlockedMax(gs_ua3, gs_ub3); // expected error: only valid in pixel stage
159 InterlockedMax(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage
160 InterlockedMin(gs_ua3, gs_ub3); // expected error: only valid in pixel stage
161 InterlockedMin(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage
162 InterlockedOr(gs_ua3, gs_ub3); // expected error: only valid in pixel stage
163 InterlockedOr(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage
164 InterlockedXor(gs_ua3, gs_ub3); // expected error: only valid in pixel stage
165 InterlockedXor(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage
166 noise(inF0); // expected error: only valid in pixel stage
167 reversebits(inF0); // expected error: only integer inputs
168 transpose(inF0); // expect error: only valid on mats
LoopDawg643fcb52016-06-03 10:53:28 -0600169
170 // TODO: texture intrinsics, when we can declare samplers.
171
172 return float3(1,2,3);
173}
174
175float4 VertexShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0)
176{
LoopDawg58910702016-06-13 09:22:28 -0600177 uint4 out_u4;
178
179 CheckAccessFullyMapped(inF0); // expect error: only valid on scalars
180 countbits(inF0); // expected error: only integer inputs
181 cross(inF0, inF1); // expected error: only on float3 inputs
182 determinant(inF0); // expect error: only valid on mats
183 ddx(inF0); // only valid in pixel stage
184 ddx_coarse(inF0); // only valid in pixel stage
185 ddx_fine(inF0); // only valid in pixel stage
186 ddy(inF0); // only valid in pixel stage
187 ddy_coarse(inF0); // only valid in pixel stage
188 ddy_fine(inF0); // only valid in pixel stage
189 EvaluateAttributeAtCentroid(inF0); // expected error: only valid in pixel stage
190 EvaluateAttributeAtSample(inF0, 2); // expected error: only valid in pixel stage
191 EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only valid in pixel stage
192 f16tof32(inF0); // expected error: only integer inputs
193 firstbithigh(inF0); // expected error: only integer inputs
194 firstbitlow(inF0); // expected error: only integer inputs
LoopDawg1b7fd0f2016-06-22 15:20:14 -0600195 // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
LoopDawg58910702016-06-13 09:22:28 -0600196 fwidth(inF0); // expected error: only valid in pixel stage
197 InterlockedAdd(gs_ua4, gs_ub4); // expected error: only valid in pixel stage
198 InterlockedAdd(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage
199 InterlockedAnd(gs_ua4, gs_ub4); // expected error: only valid in pixel stage
200 InterlockedAnd(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage
201 InterlockedCompareExchange(gs_ua4, gs_ub4, gs_uc4, out_u4); // expected error: only valid in pixel stage
202 InterlockedExchange(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage
203 InterlockedMax(gs_ua4, gs_ub4); // expected error: only valid in pixel stage
204 InterlockedMax(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage
205 InterlockedMin(gs_ua4, gs_ub4); // expected error: only valid in pixel stage
206 InterlockedMin(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage
207 InterlockedOr(gs_ua4, gs_ub4); // expected error: only valid in pixel stage
208 InterlockedOr(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage
209 InterlockedXor(gs_ua4, gs_ub4); // expected error: only valid in pixel stage
210 InterlockedXor(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage
211 noise(inF0); // expected error: only valid in pixel stage
212 reversebits(inF0); // expected error: only integer inputs
213 transpose(inF0); // expect error: only valid on mats
LoopDawg643fcb52016-06-03 10:53:28 -0600214
215 // TODO: texture intrinsics, when we can declare samplers.
216
217 return float4(1,2,3,4);
218}
219
220// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
221#define MATFNS() \
222 countbits(inF0); \
223 cross(inF0, inF1); \
224 D3DCOLORtoUBYTE4(inF0); \
225 ddx(inF0); \
226 ddx_coarse(inF0); \
227 ddx_fine(inF0); \
228 ddy(inF0); \
229 ddy_coarse(inF0); \
230 ddy_fine(inF0); \
231 EvaluateAttributeAtCentroid(inF0); \
232 EvaluateAttributeAtSample(inF0, 2); \
233 EvaluateAttributeSnapped(inF0, int2(2)); \
234 f16tof32(inF0); \
235 firstbithigh(inF0); \
236 firstbitlow(inF0); \
LoopDawg58910702016-06-13 09:22:28 -0600237 fwidth(inF0); \
LoopDawg643fcb52016-06-03 10:53:28 -0600238 noise(inF0); \
239 reversebits(inF0); \
240 length(inF0); \
241 noise(inF0); \
242 normalize(inF0); \
243 reflect(inF0, inF1); \
244 refract(inF0, inF1, 1.0); \
245 reversebits(inF0); \
246
247
248// TODO: turn on non-square matrix tests when protos are available.
249
LoopDawge903ab52016-06-30 14:13:03 -0600250float2x2 VertexShaderFunction2x2(float2x2 inF0, float2x2 inF1, float2x2 inF2)
LoopDawg643fcb52016-06-03 10:53:28 -0600251{
252 // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
253 MATFNS()
254
255 return float2x2(2,2,2,2);
256}
257
LoopDawge903ab52016-06-30 14:13:03 -0600258float3x3 VertexShaderFunction3x3(float3x3 inF0, float3x3 inF1, float3x3 inF2)
LoopDawg643fcb52016-06-03 10:53:28 -0600259{
260 // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
261 MATFNS()
262
263 return float3x3(3,3,3,3,3,3,3,3,3);
264}
265
LoopDawge903ab52016-06-30 14:13:03 -0600266float4x4 VertexShaderFunction4x4(float4x4 inF0, float4x4 inF1, float4x4 inF2)
LoopDawg643fcb52016-06-03 10:53:28 -0600267{
268 // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
269 MATFNS()
270
271 return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4);
272}