1static uint gs_ua; 2static uint gs_ub; 3static uint gs_uc; 4static uint2 gs_ua2; 5static uint2 gs_ub2; 6static uint2 gs_uc2; 7static uint3 gs_ua3; 8static uint3 gs_ub3; 9static uint3 gs_uc3; 10static uint4 gs_ua4; 11static uint4 gs_ub4; 12static uint4 gs_uc4; 13 14float VertexShaderFunctionS(float inF0, float inF1, float inF2, int inI0) 15{ 16 uint out_u1; 17 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 42 // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC 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 68 69 // TODO: texture intrinsics, when we can declare samplers. 70 71 return 0.0; 72} 73 74float1 VertexShaderFunction1(float1 inF0, float1 inF1, float1 inF2, int1 inI0) 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 83float2 VertexShaderFunction2(float2 inF0, float2 inF1, float2 inF2, int2 inI0) 84{ 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 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 105 // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC 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 124 125 // TODO: texture intrinsics, when we can declare samplers. 126 127 return float2(1,2); 128} 129 130float3 VertexShaderFunction3(float3 inF0, float3 inF1, float3 inF2, int3 inI0) 131{ 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 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 150 // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC 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 169 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{ 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 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 195 // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC 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 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 223// TODO: turn on non-square matrix tests when protos are available. 224 225float2x2 VertexShaderFunction2x2(float2x2 inF0, float2x2 inF1, float2x2 inF2) 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 233float3x3 VertexShaderFunction3x3(float3x3 inF0, float3x3 inF1, float3x3 inF2) 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 241float4x4 VertexShaderFunction4x4(float4x4 inF0, float4x4 inF1, float4x4 inF2) 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} 248