| uniform half4 colorGreen, colorRed; |
| |
| half4 main(float2 c) { |
| bool ok = true; |
| |
| // Postfix ++ and -- (scalar int). |
| int i = 5; |
| i++; |
| ok = ok && (i++ == 6); |
| ok = ok && (i == 7); |
| ok = ok && (i-- == 7); |
| ok = ok && (i == 6); |
| i--; |
| ok = ok && (i == 5); |
| |
| // Postfix ++ and -- (scalar float). |
| float f = 0.5; |
| f++; |
| ok = ok && (f++ == 1.5); |
| ok = ok && (f == 2.5); |
| ok = ok && (f-- == 2.5); |
| ok = ok && (f == 1.5); |
| f--; |
| ok = ok && (f == 0.5); |
| |
| // Postfix ++ and -- (vector-component float). |
| float2 f2 = float2(0.5); |
| f2.x++; |
| ok = ok && (f2.x++ == 1.5); |
| ok = ok && (f2.x == 2.5); |
| ok = ok && (f2.x-- == 2.5); |
| ok = ok && (f2.x == 1.5); |
| f2.x--; |
| ok = ok && (f2.x == 0.5); |
| |
| return ok ? colorGreen : colorRed; |
| } |