LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 1 | uint gs_ua; |
| 2 | uint gs_ub; |
| 3 | uint gs_uc; |
| 4 | uint2 gs_ua2; |
| 5 | uint2 gs_ub2; |
| 6 | uint2 gs_uc2; |
| 7 | uint3 gs_ua3; |
| 8 | uint3 gs_ub3; |
| 9 | uint3 gs_uc3; |
| 10 | uint4 gs_ua4; |
| 11 | uint4 gs_ub4; |
| 12 | uint4 gs_uc4; |
| 13 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame^] | 14 | float VertexShaderFunctionS(float inF0, float inF1, float inF2, int inI0) |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 15 | { |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 16 | uint out_u1; |
| 17 | |
LoopDawg | 6e72fdd | 2016-06-15 09:50:24 -0600 | [diff] [blame] | 18 | AllMemoryBarrier(); // expected error: only valid in compute stage |
| 19 | AllMemoryBarrierWithGroupSync(); // expected error: only valid in compute stage |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 20 | 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 |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 23 | clip(inF0); // expected error: only valid in pixel stage |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 24 | 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 |
LoopDawg | 6e72fdd | 2016-06-15 09:50:24 -0600 | [diff] [blame] | 27 | DeviceMemoryBarrier(); // expected error: only valid in pixel & compute stages |
| 28 | DeviceMemoryBarrierWithGroupSync(); // expected error: only valid in compute stage |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 29 | 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 |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 35 | 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 |
LoopDawg | 1b7fd0f | 2016-06-22 15:20:14 -0600 | [diff] [blame] | 42 | // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 43 | 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 |
LoopDawg | 6e72fdd | 2016-06-15 09:50:24 -0600 | [diff] [blame] | 58 | GroupMemoryBarrier(); // expected error: only valid in compute stage |
| 59 | GroupMemoryBarrierWithGroupSync(); // expected error: only valid in compute stage |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 60 | 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 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame^] | 74 | float1 VertexShaderFunction1(float1 inF0, float1 inF1, float1 inF2, int1 inI0) |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 75 | { |
| 76 | // TODO: ... add when float1 prototypes are generated |
| 77 | |
| 78 | GetRenderTargetSamplePosition(inF0); // expected error: only integer inputs |
| 79 | |
| 80 | return 0.0; |
| 81 | } |
| 82 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame^] | 83 | float2 VertexShaderFunction2(float2 inF0, float2 inF1, float2 inF2, int2 inI0) |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 84 | { |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 85 | 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 |
LoopDawg | 1b7fd0f | 2016-06-22 15:20:14 -0600 | [diff] [blame] | 105 | // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 106 | 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 |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 124 | |
| 125 | // TODO: texture intrinsics, when we can declare samplers. |
| 126 | |
| 127 | return float2(1,2); |
| 128 | } |
| 129 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame^] | 130 | float3 VertexShaderFunction3(float3 inF0, float3 inF1, float3 inF2, int3 inI0) |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 131 | { |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 132 | 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 |
LoopDawg | 1b7fd0f | 2016-06-22 15:20:14 -0600 | [diff] [blame] | 150 | // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 151 | 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 |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 169 | |
| 170 | // TODO: texture intrinsics, when we can declare samplers. |
| 171 | |
| 172 | return float3(1,2,3); |
| 173 | } |
| 174 | |
| 175 | float4 VertexShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0) |
| 176 | { |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 177 | 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 |
LoopDawg | 1b7fd0f | 2016-06-22 15:20:14 -0600 | [diff] [blame] | 195 | // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 196 | 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 |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 214 | |
| 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); \ |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 237 | fwidth(inF0); \ |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 238 | 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 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame^] | 250 | float2x2 VertexShaderFunction2x2(float2x2 inF0, float2x2 inF1, float2x2 inF2) |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 251 | { |
| 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 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame^] | 258 | float3x3 VertexShaderFunction3x3(float3x3 inF0, float3x3 inF1, float3x3 inF2) |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 259 | { |
| 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 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame^] | 266 | float4x4 VertexShaderFunction4x4(float4x4 inF0, float4x4 inF1, float4x4 inF2) |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 267 | { |
| 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 | } |