1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
/* The GLSL 4.20 spec, v11, says:
*
* "A link error will result if two compilation units in a program
* specify different integer-constant bindings for the same
* opaque-uniform name. However, it is not an error to specify a
* binding on some but not all declarations for the same name, as
* shown in the examples below."
*
* Although this restriction is not included in the
* ARB_shading_language_420pack spec, it is reasonable to believe that
* it applies to it too.
*
* Verify that a link error happens when using different binding
* points for an opaque type (image2D) with the same name in
* different compilation units.
*/
[require]
GL >= 3.00
GLSL >= 1.30
GL_ARB_shading_language_420pack
GL_ARB_shader_image_load_store
[vertex shader]
#version 130
#extension GL_ARB_shading_language_420pack: require
#extension GL_ARB_shader_image_load_store: require
layout (rgba8, binding = 0) uniform image2D img;
in vec4 piglit_vertex;
out vec4 vs_fs;
void main()
{
vs_fs = imageLoad(img, ivec2(gl_Vertex.xy));
gl_Position = piglit_vertex;
}
[fragment shader]
#version 130
#extension GL_ARB_shading_language_420pack: require
#extension GL_ARB_shader_image_load_store: require
layout (rgba8, binding = 1) uniform image2D img;
uniform ivec4 cst;
in vec4 vs_fs;
out vec4 fs_out;
void main()
{
fs_out = vs_fs * imageLoad(img, cst.xy).x;
}
[test]
link error
|