OLD | NEW |
(Empty) | |
| 1 |
| 2 /* |
| 3 ** Copyright (c) 2012 The Khronos Group Inc. |
| 4 ** |
| 5 ** Permission is hereby granted, free of charge, to any person obtaining a |
| 6 ** copy of this software and/or associated documentation files (the |
| 7 ** "Materials"), to deal in the Materials without restriction, including |
| 8 ** without limitation the rights to use, copy, modify, merge, publish, |
| 9 ** distribute, sublicense, and/or sell copies of the Materials, and to |
| 10 ** permit persons to whom the Materials are furnished to do so, subject to |
| 11 ** the following conditions: |
| 12 ** |
| 13 ** The above copyright notice and this permission notice shall be included |
| 14 ** in all copies or substantial portions of the Materials. |
| 15 ** |
| 16 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 17 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 18 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 19 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 20 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 21 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 22 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. |
| 23 */ |
| 24 |
| 25 |
| 26 #ifdef GL_ES |
| 27 precision mediump float; |
| 28 #endif |
| 29 vec4 test_function4(float); |
| 30 vec4 test_function1(float); |
| 31 vec4 test_function2(float); |
| 32 vec4 test_function3(float); |
| 33 float f = 2.6; |
| 34 |
| 35 |
| 36 vec4 test_function1(float ff) |
| 37 { |
| 38 vec4 func_vec4 = vec4(ff+f); |
| 39 return func_vec4; |
| 40 } |
| 41 |
| 42 float f1 = 1.5; |
| 43 |
| 44 vec4 test_function4(float ff) |
| 45 { |
| 46 vec4 func_vec4 = vec4(f1); |
| 47 return func_vec4; |
| 48 } |
| 49 |
| 50 float f2 = 3.5; |
| 51 |
| 52 void main() |
| 53 { |
| 54 vec4 v1 = test_function4(f2); |
| 55 vec4 v2 = test_function1(f2); |
| 56 vec4 v3 = test_function2(f2); |
| 57 vec4 v4 = test_function3(f2); |
| 58 |
| 59 if (f1 > f2) { |
| 60 gl_FragColor = v1 + v2 + v3 + v4; |
| 61 } else |
| 62 gl_FragColor = v1 + v2 + v3 + v4; |
| 63 } |
| 64 |
| 65 float f4 = 5.5; |
| 66 vec4 test_function3(float ff) |
| 67 { |
| 68 if (ff > f4) |
| 69 return vec4(ff); |
| 70 else |
| 71 return vec4(f4); |
| 72 } |
| 73 |
| 74 float f3 = 4.5; |
| 75 vec4 test_function2(float ff) |
| 76 { |
| 77 vec4 func_vec4 = vec4(ff+f3); |
| 78 return func_vec4; |
| 79 } |
| 80 |
| 81 float f5 = 6.5; |
OLD | NEW |