John Kessenich | 4e55988 | 2016-09-27 23:09:32 -0600 | [diff] [blame] | 1 | static uint gs_ua; |
| 2 | static uint gs_ub; |
| 3 | static uint gs_uc; |
| 4 | static uint2 gs_ua2; |
| 5 | static uint2 gs_ub2; |
| 6 | static uint2 gs_uc2; |
| 7 | static uint3 gs_ua3; |
| 8 | static uint3 gs_ub3; |
| 9 | static uint3 gs_uc3; |
| 10 | static uint4 gs_ua4; |
| 11 | static uint4 gs_ub4; |
| 12 | static uint4 gs_uc4; |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 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 | |
steve-lunarg | 61da5e4 | 2016-08-11 07:29:30 -0600 | [diff] [blame] | 18 | // AllMemoryBarrier(); // expected error: only valid in compute stage |
| 19 | // AllMemoryBarrierWithGroupSync(); // expected error: only valid in compute stage |
| 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 |
| 23 | // clip(inF0); // expected error: only valid in pixel stage |
| 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 |
| 27 | // DeviceMemoryBarrier(); // expected error: only valid in pixel & compute stages |
| 28 | // DeviceMemoryBarrierWithGroupSync(); // expected error: only valid in compute stage |
| 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 |
| 35 | // determinant(inF0); // expected error: only valid on mats |
| 36 | // EvaluateAttributeAtCentroid(inF0); // expected error: only interpolant |
| 37 | // EvaluateAttributeAtSample(inF0, 2); // expected error: only interpolant |
| 38 | // EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only interpolant |
| 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 |
steve-lunarg | 61da5e4 | 2016-08-11 07:29:30 -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 |
| 58 | // GroupMemoryBarrier(); // expected error: only valid in compute stage |
| 59 | // GroupMemoryBarrierWithGroupSync(); // expected error: only valid in compute stage |
| 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 |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 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 | |
steve-lunarg | 61da5e4 | 2016-08-11 07:29:30 -0600 | [diff] [blame] | 78 | // GetRenderTargetSamplePosition(inF0); // expected error: only integer inputs |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 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 | |
steve-lunarg | 61da5e4 | 2016-08-11 07:29:30 -0600 | [diff] [blame] | 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 interpolant |
| 100 | // EvaluateAttributeAtSample(inF0, 2); // expected error: only interpolant |
| 101 | // EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only interpolant |
| 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 |
steve-lunarg | 61da5e4 | 2016-08-11 07:29:30 -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 | |
steve-lunarg | 61da5e4 | 2016-08-11 07:29:30 -0600 | [diff] [blame] | 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 interpolant |
| 145 | // EvaluateAttributeAtSample(inF0, 2); // expected error: only interpolant |
| 146 | // EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only interpolant |
| 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 |
steve-lunarg | 61da5e4 | 2016-08-11 07:29:30 -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 | |
steve-lunarg | 61da5e4 | 2016-08-11 07:29:30 -0600 | [diff] [blame] | 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 interpolant |
| 190 | // EvaluateAttributeAtSample(inF0, 2); // expected error: only interpolant |
| 191 | // EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only interpolant |
| 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 |
steve-lunarg | 61da5e4 | 2016-08-11 07:29:30 -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. |
steve-lunarg | 61da5e4 | 2016-08-11 07:29:30 -0600 | [diff] [blame] | 221 | #define MATFNS() |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 222 | |
| 223 | // TODO: turn on non-square matrix tests when protos are available. |
| 224 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame] | 225 | float2x2 VertexShaderFunction2x2(float2x2 inF0, float2x2 inF1, float2x2 inF2) |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 226 | { |
| 227 | // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. |
| 228 | MATFNS() |
| 229 | |
| 230 | return float2x2(2,2,2,2); |
| 231 | } |
| 232 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame] | 233 | float3x3 VertexShaderFunction3x3(float3x3 inF0, float3x3 inF1, float3x3 inF2) |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 234 | { |
| 235 | // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. |
| 236 | MATFNS() |
| 237 | |
| 238 | return float3x3(3,3,3,3,3,3,3,3,3); |
| 239 | } |
| 240 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame] | 241 | float4x4 VertexShaderFunction4x4(float4x4 inF0, float4x4 inF1, float4x4 inF2) |
LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame] | 242 | { |
| 243 | // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. |
| 244 | MATFNS() |
| 245 | |
| 246 | return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4); |
| 247 | } |