File: different-bindings-shader-storage-blocks.shader_test

package info (click to toggle)
piglit 0~git20180515-62ef6b0db-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 102,084 kB
  • sloc: ansic: 244,201; xml: 47,485; python: 28,308; lisp: 19,320; cpp: 10,678; sh: 301; makefile: 33; pascal: 5
file content (66 lines) | stat: -rw-r--r-- 1,569 bytes parent folder | download | duplicates (4)
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
58
59
60
61
62
63
64
65
66
/* The GL 4.30 (Core Profile) spec says:
 *
 *     "7.8 Shader Buffer Variables and Shader Storage Blocks
 *
 *      ...
 *
 *      When a named shader storage block is declared by multiple
 *      shaders in a program, it must be declared identically in each
 *      shader. The buffer variables within the block must be declared
 *      with the same names, types, qualification, and declaration
 *      order. If a program contains multiple shaders with different
 *      declarations for the same named shader storage block, the
 *      program will fail to link."
 *
 * 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 Shader Storage Blocks with the same name in different
 * compilation units.
 */

[require]
GL >= 4.00
GLSL >= 1.30
GL_ARB_shading_language_420pack
GL_ARB_shader_storage_buffer_object

[vertex shader]
#version 130
#extension GL_ARB_shading_language_420pack: require
#extension GL_ARB_shader_storage_buffer_object: require

layout (binding = 0) buffer Block {
	vec4 color;
};

in vec4 piglit_vertex;
out vec4 vs_fs;

void main()
{
	vs_fs = color;
	gl_Position = piglit_vertex;
}

[fragment shader]
#version 130
#extension GL_ARB_shading_language_420pack: require
#extension GL_ARB_shader_storage_buffer_object: require

layout (binding = 1) buffer Block {
	vec4 color;
};

in  vec4 vs_fs;
out vec4 fs_out;

void main()
{
	fs_out = vs_fs * color.x;
}

[test]
link error