John Kessenich | 3471820 | 2017-04-11 17:30:08 -0600 | [diff] [blame] | 1 | float4 c4;
|
| 2 | float4 t4;
|
| 3 | float4 f4;
|
| 4 | float t;
|
| 5 | float f;
|
| 6 | |
| 7 | float4 vectorCond() |
| 8 | { |
John Kessenich | 636b62d | 2017-04-11 19:45:00 -0600 | [diff] [blame] | 9 | return (c4 ? t4 : f4) + |
John Kessenich | b5e739c | 2017-04-11 20:17:23 -0600 | [diff] [blame] | 10 | (c4 ? t : f ) + |
John Kessenich | 32a385e | 2017-04-20 21:32:16 -0600 | [diff] [blame] | 11 | (t4 < f4 ? t4 : f4) + |
| 12 | (c4 ? t : f4); |
| 13 | } |
| 14 | |
| 15 | float4 scalarCond() |
| 16 | { |
| 17 | float4 ret = t != f ? t * f4 : 1; |
| 18 | return ret; |
John Kessenich | b5e739c | 2017-04-11 20:17:23 -0600 | [diff] [blame] | 19 | } |
| 20 | |
| 21 | float2 fbSelect(bool2 cnd, float2 src0, float2 src1)
|
| 22 | {
|
| 23 | return cnd ? src0 : src1;
|
John Kessenich | 3471820 | 2017-04-11 17:30:08 -0600 | [diff] [blame] | 24 | } |
| 25 | |
John Kessenich | 00957f8 | 2016-07-27 10:39:57 -0600 | [diff] [blame] | 26 | float4 PixelShaderFunction(float4 input) : COLOR0 |
| 27 | { |
| 28 | int a = 1 < 2 ? 3 < 4 ? 5 : 6 : 7; |
| 29 | int b = 1 < 2 ? 3 > 4 ? 5 : 6 : 7; |
| 30 | int c = 1 > 2 ? 3 > 4 ? 5 : 6 : 7; |
| 31 | int d = 1 > 2 ? 3 < 4 ? 5 : 6 : 7; |
| 32 | float4 ret = a * input + |
| 33 | b * input + |
| 34 | c * input + |
| 35 | d * input; |
| 36 | int e; |
| 37 | e = a = b ? c = d : 10, b = a ? d = c : 11; |
| 38 | float4 f; |
| 39 | f = ret.x < input.y ? c * input : d * input; |
John Kessenich | 32a385e | 2017-04-20 21:32:16 -0600 | [diff] [blame] | 40 | return e * ret + f + vectorCond() + scalarCond() + |
John Kessenich | b5e739c | 2017-04-11 20:17:23 -0600 | [diff] [blame] | 41 | float4(fbSelect(bool2(true, false), float2(1.0, 2.0), float2(3.0, 4.0)), 10.0, 10.0); |
John Kessenich | 00957f8 | 2016-07-27 10:39:57 -0600 | [diff] [blame] | 42 | } |