1#version 150 2#extension GL_ARB_gpu_shader5 : require 3 4uniform ivec4 u1; 5uniform uvec4 u2; 6out vec4 result; 7vec4 f(in vec4 a, in vec4 b){ return a * b;} // choice 1 8vec4 f(in uvec4 a, in uvec4 b){ return vec4(a - b);} // choice 2 9 10void main() 11{ 12 result = f(u1, u2); // should match choice 2. which have less implicit conversion. 13 switch (gl_VertexID) 14 { 15 case 0: gl_Position = vec4(-1.0, 1.0, 0.0, 1.0); break; 16 case 1: gl_Position = vec4( 1.0, 1.0, 0.0, 1.0); break; 17 case 2: gl_Position = vec4(-1.0,-1.0, 0.0, 1.0); break; 18 case 3: gl_Position = vec4( 1.0,-1.0, 0.0, 1.0); break; 19 } 20} 21