hlsl.intrinsics.promote.frag 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. struct PS_OUTPUT { float4 color : SV_Target0; };
  2. int i;
  3. uint u;
  4. float f;
  5. bool b;
  6. int2 i2;
  7. uint2 u2;
  8. float2 f2;
  9. bool2 b2;
  10. Buffer <float> g_tTexbfs;
  11. Texture1D <float4> g_tTex1df4;
  12. uint upos;
  13. float fpos;
  14. PS_OUTPUT main()
  15. {
  16. // Same shapes:
  17. float r00 = max(b, f);
  18. uint r01 = max(b, u);
  19. int r02 = max(b, i);
  20. float r03 = max(i, f);
  21. float r04 = max(u, f);
  22. float2 r10 = max(b2, f2);
  23. uint2 r11 = max(b2, u2);
  24. int2 r12 = max(b2, i2);
  25. float2 r13 = max(i2, f2);
  26. float2 r14 = max(u2, f2);
  27. float2 r20 = clamp(i2, u2, f2); // 3 args, converts all to best type.
  28. uint2 r21 = clamp(b2, u2, b2);
  29. float2 r22 = clamp(b2, f2, b2);
  30. // Mixed shapes:
  31. float2 r30 = max(b, f2);
  32. uint2 r31 = max(b, u2);
  33. int2 r32 = max(b, i2);
  34. float2 r33 = max(i, f2);
  35. float2 r34 = max(u, f2);
  36. float2 r40 = clamp(i, u2, f2); // 3 args, converts all to best type.
  37. uint2 r41 = clamp(b2, u, b2);
  38. float2 r42 = clamp(b2, f, b);
  39. int2 r43 = clamp(i, i2, u2);
  40. float r50 = g_tTexbfs.Load(upos);
  41. float r51 = g_tTexbfs.Load(fpos);
  42. int MipLevel;
  43. uint WidthU;
  44. uint HeightU;
  45. uint ElementsU;
  46. uint DepthU;
  47. uint NumberOfLevelsU;
  48. uint NumberOfSamplesU;
  49. int WidthI;
  50. int HeightI;
  51. int ElementsI;
  52. int DepthI;
  53. int NumberOfLevelsI;
  54. int NumberOfSamplesI;
  55. g_tTex1df4 . GetDimensions(WidthI);
  56. g_tTex1df4 . GetDimensions(6, WidthI, NumberOfLevelsU);
  57. g_tTex1df4 . GetDimensions(6, WidthU, NumberOfLevelsI);
  58. g_tTex1df4 . GetDimensions(6, WidthI, NumberOfLevelsI);
  59. // max(i2, f2);
  60. PS_OUTPUT ps_output;
  61. ps_output.color = r00;
  62. return ps_output;
  63. };