1 /* The ARB_shading_language_420pack says:
3 * "Named compile-time constants or read-only variables can be declared using
4 * the const qualifier. The const qualifier can be used with any of the
5 * non-void transparent basic data types, as well as with structures and arrays
6 * of these. It is an error to write to a const variable outside of its
7 * declaration, so they must be initialized when declared. For example,
9 * const vec3 zAxis = vec3 (0.0, 0.0, 1.0);
10 * const float ceiling = a + b; // a and b not necessarily constants"
12 * Verify that const variables can be initialized with non-constant expressions.
17 GL_ARB_shading_language_420pack
19 [vertex shader passthrough]
22 #extension GL_ARB_shading_language_420pack: enable
28 const vec4 const_color = color + vec4(-1.0, 1.0, 0.0, 0.0);
29 frag_color = const_color;
33 uniform vec4 color 1.0 0.0 0.0 1.0
35 probe all rgba 0.0 1.0 0.0 1.0