1#version 400 2 3layout(constant_id = 16) const int arraySize = 5; 4in vec4 ucol[arraySize]; 5 6layout(constant_id = 17) const bool spBool = true; 7layout(constant_id = 18) const float spFloat = 3.14; 8layout(constant_id = 19) const double spDouble = 3.1415926535897932384626433832795; 9layout(constant_id = 22) const uint scale = 2; 10 11layout(constant_id = 24) gl_MaxImageUnits; 12 13out vec4 color; 14out int size; 15 16// parameter should be considered same type as ucol 17void foo(vec4 p[arraySize]); 18 19void main() 20{ 21 color = ucol[2]; 22 size = arraySize; 23 if (spBool) 24 color *= scale; 25 color += float(spDouble / spFloat); 26 27 foo(ucol); 28} 29 30layout(constant_id = 116) const int dupArraySize = 12; 31in vec4 dupUcol[dupArraySize]; 32 33layout(constant_id = 117) const bool spDupBool = true; 34layout(constant_id = 118) const float spDupFloat = 3.14; 35layout(constant_id = 119) const double spDupDouble = 3.1415926535897932384626433832795; 36layout(constant_id = 122) const uint dupScale = 2; 37 38void foo(vec4 p[arraySize]) 39{ 40 color += dupUcol[2]; 41 size += dupArraySize; 42 if (spDupBool) 43 color *= dupScale; 44 color += float(spDupDouble / spDupFloat); 45} 46 47int builtin_spec_constant() 48{ 49 int result = gl_MaxImageUnits; 50 return result; 51} 52