hlsl.conditional.frag 967 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. float4 c4;
  2. float4 t4;
  3. float4 f4;
  4. float t;
  5. float f;
  6. float4 vectorCond()
  7. {
  8. return (c4 ? t4 : f4) +
  9. (c4 ? t : f ) +
  10. (t4 < f4 ? t4 : f4) +
  11. (c4 ? t : f4);
  12. }
  13. float4 scalarCond()
  14. {
  15. float4 ret = t != f ? t * f4 : 1;
  16. return ret;
  17. }
  18. float2 fbSelect(bool2 cnd, float2 src0, float2 src1)
  19. {
  20. return cnd ? src0 : src1;
  21. }
  22. float4 PixelShaderFunction(float4 input) : COLOR0
  23. {
  24. int a = 1 < 2 ? 3 < 4 ? 5 : 6 : 7;
  25. int b = 1 < 2 ? 3 > 4 ? 5 : 6 : 7;
  26. int c = 1 > 2 ? 3 > 4 ? 5 : 6 : 7;
  27. int d = 1 > 2 ? 3 < 4 ? 5 : 6 : 7;
  28. float4 ret = a * input +
  29. b * input +
  30. c * input +
  31. d * input;
  32. int e;
  33. e = a = b ? c = d : 10, b = a ? d = c : 11;
  34. float4 f;
  35. f = ret.x < input.y ? c * input : d * input;
  36. return e * ret + f + vectorCond() + scalarCond() +
  37. float4(fbSelect(bool2(true, false), float2(1.0, 2.0), float2(3.0, 4.0)), 10.0, 10.0);
  38. }