1 /* The GLSL 4.20 spec, v11, says:
3 * "A link error will result if two compilation units in a program
4 * specify different integer-constant bindings for the same
5 * opaque-uniform name. However, it is not an error to specify a
6 * binding on some but not all declarations for the same name, as
7 * shown in the examples below."
9 * Although this restriction is not included in the
10 * ARB_shading_language_420pack spec, it is reasonable to believe that
11 * it applies to it too.
13 * Verify that a link error happens when using different binding
14 * points for an opaque type (sampler2D) with the same name in
15 * different compilation units.
20 GL_ARB_shading_language_420pack
24 #extension GL_ARB_shading_language_420pack: require
26 layout (binding = 0) uniform sampler2D tex;
28 in vec4 piglit_vertex;
33 vs_fs = texture2D(tex, gl_Vertex.xy);
34 gl_Position = piglit_vertex;
39 #extension GL_ARB_shading_language_420pack: require
41 layout (binding = 1) uniform sampler2D tex;
49 fs_out = vs_fs * texture2D(tex, cst.xy).x;