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