LoopDawg | 643fcb5 | 2016-06-03 10:53:28 -0600 | [diff] [blame^] | 1 | float VertexShaderFunction(float inF0, float inF1, float inF2, int inI0) |
| 2 | { |
| 3 | // AllMemoryBarrier(); // invalid in fragment stage TODO: parser currently crashes on empty arg list |
| 4 | // AllMemoryBarrierWithGroupSync(); // invalid in fragment stage TODO: parser currently crashes on empty arg list |
| 5 | asdouble(inF0, inF1); // expected error: only integer inputs |
| 6 | CheckAccessFullyMapped(3.0); // expected error: only valid on integers |
| 7 | CheckAccessFullyMapped(3); // expected error: only valid in pixel & compute stages |
| 8 | clip(inF0); // expected error: only valid in pixel & compute stages |
| 9 | countbits(inF0); // expected error: only integer inputs |
| 10 | cross(inF0, inF1); // expected error: only on float3 inputs |
| 11 | D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs |
| 12 | // DeviceMemoryBarrier(); // TODO: expected error: only valid in pixel & compute stages |
| 13 | // DeviceMemoryBarrierWithGroupSync(); // TODO: expected error: only valid in compute stage |
| 14 | ddx(inF0); // expected error: only valid in pixel & compute stages |
| 15 | ddx_coarse(inF0); // expected error: only valid in pixel & compute stages |
| 16 | ddx_fine(inF0); // expected error: only valid in pixel & compute stages |
| 17 | ddy(inF0); // expected error: only valid in pixel & compute stages |
| 18 | ddy_coarse(inF0); // expected error: only valid in pixel & compute stages |
| 19 | ddy_fine(inF0); // expected error: only valid in pixel & compute stages |
| 20 | determinant(inF0); // expected error: only valid on mats |
| 21 | EvaluateAttributeAtCentroid(inF0); // expected error: only valid in pixel stage |
| 22 | EvaluateAttributeAtSample(inF0, 2); // expected error: only valid in pixel stage |
| 23 | EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only valid in pixel stage |
| 24 | f16tof32(inF0); // expected error: only integer inputs |
| 25 | firstbithigh(inF0); // expected error: only integer inputs |
| 26 | firstbitlow(inF0); // expected error: only integer inputs |
| 27 | fma(inF0, inF1, inF2); // expected error: only double inputs |
| 28 | // InterlockedAdd(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator |
| 29 | // InterlockedAnd(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out i // InterlockedMax(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator |
| 30 | // InterlockedMin(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator |
| 31 | // InterlockedOor(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator |
| 32 | // InterlockedXor(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator |
| 33 | // GroupMemoryBarrier(); // TODO: expected error: only valid in compute stage |
| 34 | // GroupMemoryBarrierWithGroupSync(); // TODO: expected error: only valid in compute stage |
| 35 | length(inF0); // expect error: invalid on scalars |
| 36 | msad4(inF0, float2(0), float4(0)); // expected error: only integer inputs |
| 37 | normalize(inF0); // expect error: invalid on scalars |
| 38 | reflect(inF0, inF1); // expect error: invalid on scalars |
| 39 | refract(inF0, inF1, inF2); // expect error: invalid on scalars |
| 40 | refract(float2(0), float2(0), float2(0)); // expected error: last parameter only scalar |
| 41 | reversebits(inF0); // expected error: only integer inputs |
| 42 | transpose(inF0); // expect error: only valid on mats |
| 43 | |
| 44 | // TODO: texture intrinsics, when we can declare samplers. |
| 45 | |
| 46 | return 0.0; |
| 47 | } |
| 48 | |
| 49 | float1 VertexShaderFunction(float1 inF0, float1 inF1, float1 inF2, int1 inI0) |
| 50 | { |
| 51 | // TODO: ... add when float1 prototypes are generated |
| 52 | |
| 53 | GetRenderTargetSamplePosition(inF0); // expected error: only integer inputs |
| 54 | |
| 55 | return 0.0; |
| 56 | } |
| 57 | |
| 58 | float2 VertexShaderFunction(float2 inF0, float2 inF1, float2 inF2, int2 inI0) |
| 59 | { |
| 60 | asdouble(inF0, inF1); // expected error: only integer inputs |
| 61 | CheckAccessFullyMapped(inF0); // expect error: only valid on scalars |
| 62 | countbits(inF0); // expected error: only integer inputs |
| 63 | cross(inF0, inF1); // expected error: only on float3 inputs |
| 64 | D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs |
| 65 | ddx(inF0); // only valid in pixel & compute stages |
| 66 | ddx_coarse(inF0); // only valid in pixel & compute stages |
| 67 | ddx_fine(inF0); // only valid in pixel & compute stages |
| 68 | ddy(inF0); // only valid in pixel & compute stages |
| 69 | ddy_coarse(inF0); // only valid in pixel & compute stages |
| 70 | ddy_fine(inF0); // only valid in pixel & compute stages |
| 71 | determinant(inF0); // expect error: only valid on mats |
| 72 | EvaluateAttributeAtCentroid(inF0); // expected error: only valid in pixel stage |
| 73 | EvaluateAttributeAtSample(inF0, 2); // expected error: only valid in pixel stage |
| 74 | EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only valid in pixel stage |
| 75 | f16tof32(inF0); // expected error: only integer inputs |
| 76 | firstbithigh(inF0); // expected error: only integer inputs |
| 77 | firstbitlow(inF0); // expected error: only integer inputs |
| 78 | fma(inF0, inF1, inF2); // expected error: only double inputs |
| 79 | noise(inF0); // expected error: only valid in pixel stage |
| 80 | reversebits(inF0); // expected error: only integer inputs |
| 81 | transpose(inF0); // expect error: only valid on mats |
| 82 | |
| 83 | // TODO: texture intrinsics, when we can declare samplers. |
| 84 | |
| 85 | return float2(1,2); |
| 86 | } |
| 87 | |
| 88 | float3 VertexShaderFunction(float3 inF0, float3 inF1, float3 inF2, int3 inI0) |
| 89 | { |
| 90 | CheckAccessFullyMapped(inF0); // expect error: only valid on scalars |
| 91 | countbits(inF0); // expected error: only integer inputs |
| 92 | ddx(inF0); // only valid in pixel & compute stages |
| 93 | ddx_coarse(inF0); // only valid in pixel & compute stages |
| 94 | ddx_fine(inF0); // only valid in pixel & compute stages |
| 95 | ddy(inF0); // only valid in pixel & compute stages |
| 96 | ddy_coarse(inF0); // only valid in pixel & compute stages |
| 97 | ddy_fine(inF0); // only valid in pixel & compute stages |
| 98 | D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs |
| 99 | determinant(inF0); // expect error: only valid on mats |
| 100 | EvaluateAttributeAtCentroid(inF0); // expected error: only valid in pixel stage |
| 101 | EvaluateAttributeAtSample(inF0, 2); // expected error: only valid in pixel stage |
| 102 | EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only valid in pixel stage |
| 103 | f16tof32(inF0); // expected error: only integer inputs |
| 104 | firstbithigh(inF0); // expected error: only integer inputs |
| 105 | firstbitlow(inF0); // expected error: only integer inputs |
| 106 | fma(inF0, inF1, inF2); // expected error: only double inputs |
| 107 | noise(inF0); // expected error: only valid in pixel stage |
| 108 | reversebits(inF0); // expected error: only integer inputs |
| 109 | transpose(inF0); // expect error: only valid on mats |
| 110 | |
| 111 | // TODO: texture intrinsics, when we can declare samplers. |
| 112 | |
| 113 | return float3(1,2,3); |
| 114 | } |
| 115 | |
| 116 | float4 VertexShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0) |
| 117 | { |
| 118 | CheckAccessFullyMapped(inF0); // expect error: only valid on scalars |
| 119 | countbits(inF0); // expected error: only integer inputs |
| 120 | cross(inF0, inF1); // expected error: only on float3 inputs |
| 121 | determinant(inF0); // expect error: only valid on mats |
| 122 | ddx(inF0); // only valid in pixel & compute stages |
| 123 | ddx_coarse(inF0); // only valid in pixel & compute stages |
| 124 | ddx_fine(inF0); // only valid in pixel & compute stages |
| 125 | ddy(inF0); // only valid in pixel & compute stages |
| 126 | ddy_coarse(inF0); // only valid in pixel & compute stages |
| 127 | ddy_fine(inF0); // only valid in pixel & compute stages |
| 128 | EvaluateAttributeAtCentroid(inF0); // expected error: only valid in pixel stage |
| 129 | EvaluateAttributeAtSample(inF0, 2); // expected error: only valid in pixel stage |
| 130 | EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only valid in pixel stage |
| 131 | f16tof32(inF0); // expected error: only integer inputs |
| 132 | firstbithigh(inF0); // expected error: only integer inputs |
| 133 | firstbitlow(inF0); // expected error: only integer inputs |
| 134 | fma(inF0, inF1, inF2); // expected error: only double inputs |
| 135 | noise(inF0); // expected error: only valid in pixel stage |
| 136 | reversebits(inF0); // expected error: only integer inputs |
| 137 | transpose(inF0); // expect error: only valid on mats |
| 138 | |
| 139 | // TODO: texture intrinsics, when we can declare samplers. |
| 140 | |
| 141 | return float4(1,2,3,4); |
| 142 | } |
| 143 | |
| 144 | // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. |
| 145 | #define MATFNS() \ |
| 146 | countbits(inF0); \ |
| 147 | cross(inF0, inF1); \ |
| 148 | D3DCOLORtoUBYTE4(inF0); \ |
| 149 | ddx(inF0); \ |
| 150 | ddx_coarse(inF0); \ |
| 151 | ddx_fine(inF0); \ |
| 152 | ddy(inF0); \ |
| 153 | ddy_coarse(inF0); \ |
| 154 | ddy_fine(inF0); \ |
| 155 | EvaluateAttributeAtCentroid(inF0); \ |
| 156 | EvaluateAttributeAtSample(inF0, 2); \ |
| 157 | EvaluateAttributeSnapped(inF0, int2(2)); \ |
| 158 | f16tof32(inF0); \ |
| 159 | firstbithigh(inF0); \ |
| 160 | firstbitlow(inF0); \ |
| 161 | fma(inF0, inF1, inF2); \ |
| 162 | noise(inF0); \ |
| 163 | reversebits(inF0); \ |
| 164 | length(inF0); \ |
| 165 | noise(inF0); \ |
| 166 | normalize(inF0); \ |
| 167 | reflect(inF0, inF1); \ |
| 168 | refract(inF0, inF1, 1.0); \ |
| 169 | reversebits(inF0); \ |
| 170 | |
| 171 | |
| 172 | // TODO: turn on non-square matrix tests when protos are available. |
| 173 | |
| 174 | float2x2 VertexShaderFunction(float2x2 inF0, float2x2 inF1, float2x2 inF2) |
| 175 | { |
| 176 | // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. |
| 177 | MATFNS() |
| 178 | |
| 179 | return float2x2(2,2,2,2); |
| 180 | } |
| 181 | |
| 182 | float3x3 VertexShaderFunction(float3x3 inF0, float3x3 inF1, float3x3 inF2) |
| 183 | { |
| 184 | // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. |
| 185 | MATFNS() |
| 186 | |
| 187 | return float3x3(3,3,3,3,3,3,3,3,3); |
| 188 | } |
| 189 | |
| 190 | float4x4 VertexShaderFunction(float4x4 inF0, float4x4 inF1, float4x4 inF2) |
| 191 | { |
| 192 | // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. |
| 193 | MATFNS() |
| 194 | |
| 195 | return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4); |
| 196 | } |