LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 1 | |
John Kessenich | 4e55988 | 2016-09-27 23:09:32 -0600 | [diff] [blame] | 2 | #define gs static // TODO: define as groupshared when available in the grammar |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 3 | gs uint gs_ua; |
| 4 | gs uint gs_ub; |
| 5 | gs uint gs_uc; |
| 6 | gs uint2 gs_ua2; |
| 7 | gs uint2 gs_ub2; |
| 8 | gs uint2 gs_uc2; |
| 9 | gs uint3 gs_ua3; |
| 10 | gs uint3 gs_ub3; |
| 11 | gs uint3 gs_uc3; |
| 12 | gs uint4 gs_ua4; |
| 13 | gs uint4 gs_ub4; |
| 14 | gs uint4 gs_uc4; |
| 15 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame] | 16 | float PixelShaderFunctionS(float inF0, float inF1, float inF2, uint inU0, uint inU1) |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 17 | { |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 18 | uint out_u1; |
| 19 | |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 20 | bool r000 = all(inF0); |
| 21 | float r001 = abs(inF0); |
| 22 | float r002 = acos(inF0); |
| 23 | bool r003 = any(inF0); |
| 24 | float r004 = asin(inF0); |
| 25 | int r005 = asint(inF0); |
| 26 | uint r006 = asuint(inF0); |
| 27 | float r007 = asfloat(inU0); |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 28 | // asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 29 | float r009 = atan(inF0); |
| 30 | float r010 = atan2(inF0, inF1); |
| 31 | float r011 = ceil(inF0); |
| 32 | float r012 = clamp(inF0, inF1, inF2); |
LoopDawg | 592860c | 2016-06-09 08:57:35 -0600 | [diff] [blame] | 33 | clip(inF0); |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 34 | float r014 = cos(inF0); |
| 35 | float r015 = cosh(inF0); |
| 36 | uint r016 = countbits(7); |
| 37 | float r017 = ddx(inF0); |
| 38 | float r018 = ddx_coarse(inF0); |
| 39 | float r019 = ddx_fine(inF0); |
| 40 | float r020 = ddy(inF0); |
| 41 | float r021 = ddy_coarse(inF0); |
| 42 | float r022 = ddy_fine(inF0); |
| 43 | float r023 = degrees(inF0); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 44 | // EvaluateAttributeAtCentroid(inF0); |
| 45 | // EvaluateAttributeAtSample(inF0, 0); |
| 46 | // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 47 | float r027 = exp(inF0); |
| 48 | float r028 = exp2(inF0); |
| 49 | uint r029 = firstbithigh(7); |
| 50 | uint r030 = firstbitlow(7); |
| 51 | float r031 = floor(inF0); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 52 | // TODO: fma(inD0, inD1, inD2); |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 53 | float r033 = fmod(inF0, inF1); |
| 54 | float r034 = frac(inF0); |
| 55 | float r035 = frexp(inF0, inF1); |
| 56 | float r036 = fwidth(inF0); |
| 57 | bool r037 = isinf(inF0); |
| 58 | bool r038 = isnan(inF0); |
| 59 | float r039 = ldexp(inF0, inF1); |
| 60 | float r039a = lerp(inF0, inF1, inF2); |
| 61 | float r040 = log(inF0); |
| 62 | float r041 = log10(inF0); |
| 63 | float r042 = log2(inF0); |
| 64 | float r043 = max(inF0, inF1); |
| 65 | float r044 = min(inF0, inF1); |
| 66 | float r045 = pow(inF0, inF1); |
| 67 | float r046 = radians(inF0); |
| 68 | float r047 = rcp(inF0); |
| 69 | uint r048 = reversebits(2); |
| 70 | float r049 = round(inF0); |
| 71 | float r050 = rsqrt(inF0); |
| 72 | float r051 = saturate(inF0); |
| 73 | float r052 = sign(inF0); |
| 74 | float r053 = sin(inF0); |
LoopDawg | 592860c | 2016-06-09 08:57:35 -0600 | [diff] [blame] | 75 | sincos(inF0, inF1, inF2); |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 76 | float r055 = sinh(inF0); |
| 77 | float r056 = smoothstep(inF0, inF1, inF2); |
| 78 | float r057 = sqrt(inF0); |
| 79 | float r058 = step(inF0, inF1); |
| 80 | float r059 = tan(inF0); |
| 81 | float r060 = tanh(inF0); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 82 | // TODO: sampler intrinsics, when we can declare the types. |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 83 | float r061 = trunc(inF0); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 84 | |
| 85 | return 0.0; |
| 86 | } |
| 87 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame] | 88 | float1 PixelShaderFunction1(float1 inF0, float1 inF1, float1 inF2) |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 89 | { |
| 90 | // TODO: ... add when float1 prototypes are generated |
| 91 | return 0.0; |
| 92 | } |
| 93 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame] | 94 | float2 PixelShaderFunction2(float2 inF0, float2 inF1, float2 inF2, uint2 inU0, uint2 inU1) |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 95 | { |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 96 | uint2 out_u2; |
| 97 | |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 98 | bool r000 = all(inF0); |
| 99 | float2 r001 = abs(inF0); |
| 100 | float2 r002 = acos(inF0); |
| 101 | bool r003 = any(inF0); |
| 102 | float2 r004 = asin(inF0); |
| 103 | int2 r005 = asint(inF0); |
| 104 | uint2 r006 = asuint(inF0); |
| 105 | float2 r007 = asfloat(inU0); |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 106 | // asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 107 | float2 r009 = atan(inF0); |
| 108 | float2 r010 = atan2(inF0, inF1); |
| 109 | float2 r011 = ceil(inF0); |
| 110 | float2 r012 = clamp(inF0, inF1, inF2); |
LoopDawg | 592860c | 2016-06-09 08:57:35 -0600 | [diff] [blame] | 111 | clip(inF0); |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 112 | float2 r013 = cos(inF0); |
| 113 | float2 r015 = cosh(inF0); |
| 114 | uint2 r016 = countbits(int2(7,3)); |
| 115 | float2 r017 = ddx(inF0); |
| 116 | float2 r018 = ddx_coarse(inF0); |
| 117 | float2 r019 = ddx_fine(inF0); |
| 118 | float2 r020 = ddy(inF0); |
| 119 | float2 r021 = ddy_coarse(inF0); |
| 120 | float2 r022 = ddy_fine(inF0); |
| 121 | float2 r023 = degrees(inF0); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 122 | // EvaluateAttributeAtCentroid(inF0); |
| 123 | // EvaluateAttributeAtSample(inF0, 0); |
| 124 | // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 125 | float r026 = distance(inF0, inF1); |
| 126 | float r027 = dot(inF0, inF1); |
| 127 | // EvaluateAttributeAtCentroid(inF0); |
| 128 | // EvaluateAttributeAtSample(inF0, 0); |
| 129 | // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); |
| 130 | float2 r028 = exp(inF0); |
| 131 | float2 r029 = exp2(inF0); |
| 132 | float2 r030 = faceforward(inF0, inF1, inF2); |
| 133 | uint2 r031 = firstbithigh(uint2(7,8)); |
| 134 | uint2 r032 = firstbitlow(uint2(7,8)); |
| 135 | float2 r033 = floor(inF0); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 136 | // TODO: fma(inD0, inD1, inD2); |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 137 | float2 r035 = fmod(inF0, inF1); |
| 138 | float2 r036 = frac(inF0); |
| 139 | float2 r037 = frexp(inF0, inF1); |
| 140 | float2 r038 = fwidth(inF0); |
| 141 | bool2 r039 = isinf(inF0); |
| 142 | bool2 r040 = isnan(inF0); |
| 143 | float2 r041 = ldexp(inF0, inF1); |
| 144 | float2 r039a = lerp(inF0, inF1, inF2); |
| 145 | float r042 = length(inF0); |
| 146 | float2 r043 = log(inF0); |
| 147 | float2 r044 = log10(inF0); |
| 148 | float2 r045 = log2(inF0); |
| 149 | float2 r046 = max(inF0, inF1); |
| 150 | float2 r047 = min(inF0, inF1); |
| 151 | float2 r048 = normalize(inF0); |
| 152 | float2 r049 = pow(inF0, inF1); |
| 153 | float2 r050 = radians(inF0); |
| 154 | float2 r051 = rcp(inF0); |
| 155 | float2 r052 = reflect(inF0, inF1); |
| 156 | float2 r053 = refract(inF0, inF1, 2.0); |
| 157 | uint2 r054 = reversebits(uint2(1,2)); |
| 158 | float2 r055 = round(inF0); |
| 159 | float2 r056 = rsqrt(inF0); |
| 160 | float2 r057 = saturate(inF0); |
| 161 | float2 r058 = sign(inF0); |
| 162 | float2 r059 = sin(inF0); |
LoopDawg | 592860c | 2016-06-09 08:57:35 -0600 | [diff] [blame] | 163 | sincos(inF0, inF1, inF2); |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 164 | float2 r060 = sinh(inF0); |
| 165 | float2 r061 = smoothstep(inF0, inF1, inF2); |
| 166 | float2 r062 = sqrt(inF0); |
| 167 | float2 r063 = step(inF0, inF1); |
| 168 | float2 r064 = tan(inF0); |
| 169 | float2 r065 = tanh(inF0); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 170 | // TODO: sampler intrinsics, when we can declare the types. |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 171 | float2 r066 = trunc(inF0); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 172 | |
| 173 | // TODO: ... add when float1 prototypes are generated |
| 174 | return float2(1,2); |
| 175 | } |
| 176 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame] | 177 | float3 PixelShaderFunction3(float3 inF0, float3 inF1, float3 inF2, uint3 inU0, uint3 inU1) |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 178 | { |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 179 | uint3 out_u3; |
| 180 | |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 181 | bool r000 = all(inF0); |
| 182 | float3 r001 = abs(inF0); |
| 183 | float3 r002 = acos(inF0); |
| 184 | bool r003 = any(inF0); |
| 185 | float3 r004 = asin(inF0); |
| 186 | int3 r005 = asint(inF0); |
| 187 | uint3 r006 = asuint(inF0); |
| 188 | float3 r007 = asfloat(inU0); |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 189 | // asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 190 | float3 r009 = atan(inF0); |
| 191 | float3 r010 = atan2(inF0, inF1); |
| 192 | float3 r011 = ceil(inF0); |
| 193 | float3 r012 = clamp(inF0, inF1, inF2); |
LoopDawg | 592860c | 2016-06-09 08:57:35 -0600 | [diff] [blame] | 194 | clip(inF0); |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 195 | float3 r013 = cos(inF0); |
| 196 | float3 r014 = cosh(inF0); |
| 197 | uint3 r015 = countbits(uint3(7,3,5)); |
| 198 | float3 r016 = cross(inF0, inF1); |
| 199 | float3 r017 = ddx(inF0); |
| 200 | float3 r018 = ddx_coarse(inF0); |
| 201 | float3 r019 = ddx_fine(inF0); |
| 202 | float3 r020 = ddy(inF0); |
| 203 | float3 r021 = ddy_coarse(inF0); |
| 204 | float3 r022 = ddy_fine(inF0); |
| 205 | float3 r023 = degrees(inF0); |
| 206 | float r024 = distance(inF0, inF1); |
| 207 | float r025 = dot(inF0, inF1); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 208 | // EvaluateAttributeAtCentroid(inF0); |
| 209 | // EvaluateAttributeAtSample(inF0, 0); |
| 210 | // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 211 | float3 r029 = exp(inF0); |
| 212 | float3 r030 = exp2(inF0); |
| 213 | float3 r031 = faceforward(inF0, inF1, inF2); |
| 214 | uint3 r032 = firstbithigh(uint3(2,3,4)); |
| 215 | uint3 r033 = firstbitlow(uint3(2,3,4)); |
| 216 | float3 r034 = floor(inF0); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 217 | // TODO: fma(inD0, inD1, inD2); |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 218 | float3 r036 = fmod(inF0, inF1); |
| 219 | float3 r037 = frac(inF0); |
| 220 | float3 r038 = frexp(inF0, inF1); |
| 221 | float3 r039 = fwidth(inF0); |
| 222 | bool3 r040 = isinf(inF0); |
| 223 | bool3 r041 = isnan(inF0); |
| 224 | float3 r042 = ldexp(inF0, inF1); |
| 225 | float3 r039a = lerp(inF0, inF1, inF2); |
steve-lunarg | cf57c04 | 2016-07-28 13:20:57 -0600 | [diff] [blame] | 226 | float3 r039b = lerp(inF0, inF1, 0.3); // test vec,vec,scalar lerp |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 227 | float r043 = length(inF0); |
| 228 | float3 r044 = log(inF0); |
| 229 | float3 r045 = log10(inF0); |
| 230 | float3 r046 = log2(inF0); |
| 231 | float3 r047 = max(inF0, inF1); |
| 232 | float3 r048 = min(inF0, inF1); |
| 233 | float3 r049 = normalize(inF0); |
| 234 | float3 r050 = pow(inF0, inF1); |
| 235 | float3 r051 = radians(inF0); |
| 236 | float3 r052 = rcp(inF0); |
| 237 | float3 r053 = reflect(inF0, inF1); |
| 238 | float3 r054 = refract(inF0, inF1, 2.0); |
| 239 | uint3 r055 = reversebits(uint3(1,2,3)); |
| 240 | float3 r056 = round(inF0); |
| 241 | float3 r057 = rsqrt(inF0); |
| 242 | float3 r058 = saturate(inF0); |
| 243 | float3 r059 = sign(inF0); |
| 244 | float3 r060 = sin(inF0); |
LoopDawg | 592860c | 2016-06-09 08:57:35 -0600 | [diff] [blame] | 245 | sincos(inF0, inF1, inF2); |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 246 | float3 r061 = sinh(inF0); |
| 247 | float3 r062 = smoothstep(inF0, inF1, inF2); |
| 248 | float3 r063 = sqrt(inF0); |
| 249 | float3 r064 = step(inF0, inF1); |
| 250 | float3 r065 = tan(inF0); |
| 251 | float3 r066 = tanh(inF0); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 252 | // TODO: sampler intrinsics, when we can declare the types. |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 253 | float3 r067 = trunc(inF0); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 254 | |
| 255 | // TODO: ... add when float1 prototypes are generated |
| 256 | return float3(1,2,3); |
| 257 | } |
| 258 | |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 259 | float4 PixelShaderFunction(float4 inF0, float4 inF1, float4 inF2, uint4 inU0, uint4 inU1) |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 260 | { |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 261 | uint4 out_u4; |
| 262 | |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 263 | bool r000 = all(inF0); |
| 264 | float4 r001 = abs(inF0); |
| 265 | float4 r002 = acos(inF0); |
| 266 | bool r003 = any(inF0); |
| 267 | float4 r004 = asin(inF0); |
| 268 | int4 r005 = asint(inF0); |
| 269 | uint4 r006 = asuint(inF0); |
| 270 | float4 r007 = asfloat(inU0); |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 271 | // asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 272 | float4 r009 = atan(inF0); |
| 273 | float4 r010 = atan2(inF0, inF1); |
| 274 | float4 r011 = ceil(inF0); |
| 275 | float4 r012 = clamp(inF0, inF1, inF2); |
LoopDawg | 592860c | 2016-06-09 08:57:35 -0600 | [diff] [blame] | 276 | clip(inF0); |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 277 | float4 r013 = cos(inF0); |
| 278 | float4 r014 = cosh(inF0); |
| 279 | uint4 r015 = countbits(uint4(7,3,5,2)); |
| 280 | float4 r016 = ddx(inF0); |
| 281 | float4 r017 = ddx_coarse(inF0); |
| 282 | float4 r018 = ddx_fine(inF0); |
| 283 | float4 r019 = ddy(inF0); |
| 284 | float4 r020 = ddy_coarse(inF0); |
| 285 | float4 r021 = ddy_fine(inF0); |
| 286 | float4 r022 = degrees(inF0); |
| 287 | float r023 = distance(inF0, inF1); |
| 288 | float r024 = dot(inF0, inF1); |
| 289 | float4 r025 = dst(inF0, inF1); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 290 | // EvaluateAttributeAtCentroid(inF0); |
| 291 | // EvaluateAttributeAtSample(inF0, 0); |
| 292 | // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 293 | float4 r029 = exp(inF0); |
| 294 | float4 r030 = exp2(inF0); |
| 295 | float4 r031 = faceforward(inF0, inF1, inF2); |
| 296 | uint4 r032 = firstbithigh(uint4(7,8,9,10)); |
| 297 | uint4 r033 = firstbitlow(uint4(7,8,9,10)); |
| 298 | float4 r034 = floor(inF0); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 299 | // TODO: fma(inD0, inD1, inD2); |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 300 | float4 r036 = fmod(inF0, inF1); |
| 301 | float4 r037 = frac(inF0); |
| 302 | float4 r038 = frexp(inF0, inF1); |
| 303 | float4 r039 = fwidth(inF0); |
| 304 | bool4 r040 = isinf(inF0); |
| 305 | bool4 r041 = isnan(inF0); |
| 306 | float4 r042 = ldexp(inF0, inF1); |
| 307 | float4 r039a = lerp(inF0, inF1, inF2); |
| 308 | float r043 = length(inF0); |
| 309 | float4 r044 = log(inF0); |
| 310 | float4 r045 = log10(inF0); |
| 311 | float4 r046 = log2(inF0); |
| 312 | float4 r047 = max(inF0, inF1); |
| 313 | float4 r048 = min(inF0, inF1); |
| 314 | float4 r049 = normalize(inF0); |
| 315 | float4 r050 = pow(inF0, inF1); |
| 316 | float4 r051 = radians(inF0); |
| 317 | float4 r052 = rcp(inF0); |
| 318 | float4 r053 = reflect(inF0, inF1); |
| 319 | float4 r054 = refract(inF0, inF1, 2.0); |
| 320 | uint4 r055 = reversebits(uint4(1,2,3,4)); |
| 321 | float4 r056 = round(inF0); |
| 322 | float4 r057 = rsqrt(inF0); |
| 323 | float4 r058 = saturate(inF0); |
| 324 | float4 r059 = sign(inF0); |
| 325 | float4 r060 = sin(inF0); |
LoopDawg | 592860c | 2016-06-09 08:57:35 -0600 | [diff] [blame] | 326 | sincos(inF0, inF1, inF2); |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 327 | float4 r061 = sinh(inF0); |
| 328 | float4 r062 = smoothstep(inF0, inF1, inF2); |
| 329 | float4 r063 = sqrt(inF0); |
| 330 | float4 r064 = step(inF0, inF1); |
| 331 | float4 r065 = tan(inF0); |
| 332 | float4 r066 = tanh(inF0); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 333 | // TODO: sampler intrinsics, when we can declare the types. |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 334 | float4 r067 = trunc(inF0); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 335 | |
| 336 | // TODO: ... add when float1 prototypes are generated |
| 337 | return float4(1,2,3,4); |
| 338 | } |
| 339 | |
LoopDawg | 5891070 | 2016-06-13 09:22:28 -0600 | [diff] [blame] | 340 | // TODO: for mats: |
| 341 | // asfloat(inU0); \ |
| 342 | // asint(inF0); \ |
| 343 | // asuint(inF0); \ |
| 344 | |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 345 | // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 346 | #define MATFNS(MT) \ |
| 347 | bool r000 = all(inF0); \ |
| 348 | MT r001 = abs(inF0); \ |
| 349 | acos(inF0); \ |
| 350 | bool r003 = any(inF0); \ |
| 351 | MT r004 = asin(inF0); \ |
| 352 | MT r005 = atan(inF0); \ |
| 353 | MT r006 = atan2(inF0, inF1); \ |
| 354 | MT r007 = ceil(inF0); \ |
| 355 | clip(inF0); \ |
| 356 | MT r008 = clamp(inF0, inF1, inF2); \ |
| 357 | MT r009 = cos(inF0); \ |
| 358 | MT r010 = cosh(inF0); \ |
| 359 | MT r011 = ddx(inF0); \ |
| 360 | MT r012 = ddx_coarse(inF0); \ |
| 361 | MT r013 = ddx_fine(inF0); \ |
| 362 | MT r014 = ddy(inF0); \ |
| 363 | MT r015 = ddy_coarse(inF0); \ |
| 364 | MT r016 = ddy_fine(inF0); \ |
| 365 | MT r017 = degrees(inF0); \ |
| 366 | float r018 = determinant(inF0); \ |
| 367 | MT r019 = exp(inF0); \ |
| 368 | MT R020 = exp2(inF0); \ |
| 369 | MT r021 = floor(inF0); \ |
| 370 | MT r022 = fmod(inF0, inF1); \ |
| 371 | MT r023 = frac(inF0); \ |
| 372 | MT r024 = frexp(inF0, inF1); \ |
| 373 | MT r025 = fwidth(inF0); \ |
| 374 | MT r026 = ldexp(inF0, inF1); \ |
| 375 | MT r026a = lerp(inF0, inF1, inF2); \ |
| 376 | MT r027 = log(inF0); \ |
| 377 | MT r028 = log10(inF0); \ |
| 378 | MT r029 = log2(inF0); \ |
| 379 | MT r030 = max(inF0, inF1); \ |
| 380 | MT r031 = min(inF0, inF1); \ |
| 381 | MT r032 = pow(inF0, inF1); \ |
| 382 | MT r033 = radians(inF0); \ |
| 383 | MT r034 = round(inF0); \ |
| 384 | MT r035 = rsqrt(inF0); \ |
| 385 | MT r036 = saturate(inF0); \ |
| 386 | MT r037 = sign(inF0); \ |
| 387 | MT r038 = sin(inF0); \ |
| 388 | sincos(inF0, inF1, inF2); \ |
| 389 | MT r039 = sinh(inF0); \ |
| 390 | MT r049 = smoothstep(inF0, inF1, inF2); \ |
| 391 | MT r041 = sqrt(inF0); \ |
| 392 | MT r042 = step(inF0, inF1); \ |
| 393 | MT r043 = tan(inF0); \ |
| 394 | MT r044 = tanh(inF0); \ |
| 395 | transpose(inF0); \ |
| 396 | MT r046 = trunc(inF0); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 397 | |
| 398 | // TODO: turn on non-square matrix tests when protos are available. |
| 399 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame] | 400 | float2x2 PixelShaderFunction2x2(float2x2 inF0, float2x2 inF1, float2x2 inF2) |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 401 | { |
| 402 | // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 403 | MATFNS(float2x2); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 404 | |
| 405 | // TODO: ... add when float1 prototypes are generated |
| 406 | return float2x2(2,2,2,2); |
| 407 | } |
| 408 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame] | 409 | float3x3 PixelShaderFunction3x3(float3x3 inF0, float3x3 inF1, float3x3 inF2) |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 410 | { |
| 411 | // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 412 | MATFNS(float3x3); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 413 | |
| 414 | // TODO: ... add when float1 prototypes are generated |
| 415 | return float3x3(3,3,3,3,3,3,3,3,3); |
| 416 | } |
| 417 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame] | 418 | float4x4 PixelShaderFunction4x4(float4x4 inF0, float4x4 inF1, float4x4 inF2) |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 419 | { |
| 420 | // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 421 | MATFNS(float4x4); |
LoopDawg | 4b67732 | 2016-05-26 10:10:16 -0600 | [diff] [blame] | 422 | |
| 423 | // TODO: ... add when float1 prototypes are generated |
| 424 | return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4); |
| 425 | } |
LoopDawg | 592860c | 2016-06-09 08:57:35 -0600 | [diff] [blame] | 426 | |
| 427 | #define TESTGENMUL(ST, VT, MT) \ |
| 428 | ST r0 = mul(inF0, inF1); \ |
| 429 | VT r1 = mul(inFV0, inF0); \ |
| 430 | VT r2 = mul(inF0, inFV0); \ |
| 431 | ST r3 = mul(inFV0, inFV1); \ |
| 432 | VT r4 = mul(inFM0, inFV0); \ |
| 433 | VT r5 = mul(inFV0, inFM0); \ |
| 434 | MT r6 = mul(inFM0, inF0); \ |
| 435 | MT r7 = mul(inF0, inFM0); \ |
| 436 | MT r8 = mul(inFM0, inFM1); |
| 437 | |
| 438 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame] | 439 | void TestGenMul2(float inF0, float inF1, |
LoopDawg | 592860c | 2016-06-09 08:57:35 -0600 | [diff] [blame] | 440 | float2 inFV0, float2 inFV1, |
| 441 | float2x2 inFM0, float2x2 inFM1) |
| 442 | { |
| 443 | TESTGENMUL(float, float2, float2x2); |
| 444 | } |
| 445 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame] | 446 | void TestGenMul3(float inF0, float inF1, |
LoopDawg | 592860c | 2016-06-09 08:57:35 -0600 | [diff] [blame] | 447 | float3 inFV0, float3 inFV1, |
| 448 | float3x3 inFM0, float3x3 inFM1) |
| 449 | { |
| 450 | TESTGENMUL(float, float3, float3x3); |
| 451 | } |
| 452 | |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame] | 453 | void TestGenMul4(float inF0, float inF1, |
LoopDawg | 592860c | 2016-06-09 08:57:35 -0600 | [diff] [blame] | 454 | float4 inFV0, float4 inFV1, |
| 455 | float4x4 inFM0, float4x4 inFM1) |
| 456 | { |
| 457 | TESTGENMUL(float, float4, float4x4); |
| 458 | } |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 459 | |
| 460 | // Test some non-square mats |
LoopDawg | e903ab5 | 2016-06-30 14:13:03 -0600 | [diff] [blame] | 461 | void TestGenMulNxM(float inF0, float inF1, |
| 462 | float2 inFV2, float3 inFV3, |
| 463 | float2x3 inFM2x3, float3x2 inFM3x2, |
| 464 | float3x3 inFM3x3, float3x4 inFM3x4, |
| 465 | float2x4 inFM2x4) |
LoopDawg | 4624a02 | 2016-06-20 13:26:59 -0600 | [diff] [blame] | 466 | { |
| 467 | float r00 = mul(inF0, inF1); // S=S*S |
| 468 | float2 r01 = mul(inFV2, inF0); // V=V*S |
| 469 | float3 r02 = mul(inFV3, inF0); // V=V*S |
| 470 | float2 r03 = mul(inF0, inFV2); // V=S*V |
| 471 | float3 r04 = mul(inF0, inFV3); // V=S*V |
| 472 | float r05 = mul(inFV2, inFV2); // S=V*V |
| 473 | float r06 = mul(inFV3, inFV3); // S=V*V |
| 474 | float3 r07 = mul(inFV2, inFM2x3); // V=V*M (return V dim is Mcols) |
| 475 | float2 r08 = mul(inFV3, inFM3x2); // V=V*M (return V dim is Mcols) |
| 476 | float2 r09 = mul(inFM2x3, inFV3); // V=M*V (return V dim is Mrows) |
| 477 | float3 r10 = mul(inFM3x2, inFV2); // V=M*V (return V dim is Mrows) |
| 478 | float2x3 r11 = mul(inFM2x3, inF0); |
| 479 | float3x2 r12 = mul(inFM3x2, inF0); |
| 480 | float2x2 r13 = mul(inFM2x3, inFM3x2); |
| 481 | float2x3 r14 = mul(inFM2x3, inFM3x3); |
| 482 | float2x4 r15 = mul(inFM2x3, inFM3x4); |
| 483 | float3x4 r16 = mul(inFM3x2, inFM2x4); |
| 484 | } |
steve-lunarg | 297ae21 | 2016-08-24 14:36:13 -0600 | [diff] [blame] | 485 | |
| 486 | struct PS_OUTPUT { float4 color : SV_Target0; }; |
| 487 | |
| 488 | PS_OUTPUT main() |
| 489 | { |
| 490 | PS_OUTPUT ps_output; |
| 491 | ps_output.color = 1.0; |
| 492 | return ps_output; |
| 493 | }; |