3 GL_ARB_uniform_buffer_object
6 #extension GL_ARB_uniform_buffer_object : require
18 /* Section 2.11.4 (Uniform Variables), subsection Standard Uniform
19 * Block Layout, of the OpenGL 3.1 spec says (emphasis mine):
21 * "(9) If the member is a structure, the base alignment of the
22 * structure is <N>, where <N> is the largest base alignment value
23 * of any of its members, and *rounded up to the base alignment of
24 * a vec4*. The individual members of this sub-structure are then
25 * assigned offsets by applying this set of rules recursively,
26 * where the base offset of the first member of the sub-structure
27 * is equal to the aligned offset of the structure. The structure
28 * may have padding at the end; the base offset of the member
29 * following the sub-structure is rounded up to the next multiple
30 * of the base alignment of the structure."
37 layout(std140) uniform ubo1 {
41 in vec4 piglit_vertex;
46 /* std140 (or shared) layout prevents any fields or blocks from being
47 * eliminted. Section 2.11.6 of the OpenGL ES 3.0 spec makes this
48 * explicit, but desktop GL specs only say it implicitly. Either way,
49 * there is no need to reference any field of the std140 block.
51 gl_Position = piglit_vertex;
53 pass = int(s.s2.g == 3.3);
58 out vec4 piglit_fragcolor;
63 piglit_fragcolor = bool(pass) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
69 active uniform s.s1.r GL_UNIFORM_TYPE GL_FLOAT
70 active uniform s.s1.r GL_UNIFORM_SIZE 1
71 active uniform s.s1.r GL_UNIFORM_OFFSET 0
72 active uniform s.s1.r GL_UNIFORM_ARRAY_STRIDE 0
73 active uniform s.s1.r GL_UNIFORM_MATRIX_STRIDE 0
74 active uniform s.s1.r GL_UNIFORM_IS_ROW_MAJOR 0
76 active uniform s.s2.g GL_UNIFORM_TYPE GL_FLOAT
77 active uniform s.s2.g GL_UNIFORM_SIZE 1
78 active uniform s.s2.g GL_UNIFORM_OFFSET 16
79 active uniform s.s2.g GL_UNIFORM_ARRAY_STRIDE 0
80 active uniform s.s2.g GL_UNIFORM_MATRIX_STRIDE 0
81 active uniform s.s2.g GL_UNIFORM_IS_ROW_MAJOR 0
83 active uniform s.s2.b GL_UNIFORM_TYPE GL_FLOAT
84 active uniform s.s2.b GL_UNIFORM_SIZE 1
85 active uniform s.s2.b GL_UNIFORM_OFFSET 20
86 active uniform s.s2.b GL_UNIFORM_ARRAY_STRIDE 0
87 active uniform s.s2.b GL_UNIFORM_MATRIX_STRIDE 0
88 active uniform s.s2.b GL_UNIFORM_IS_ROW_MAJOR 0
90 active uniform s.s2.a GL_UNIFORM_TYPE GL_FLOAT
91 active uniform s.s2.a GL_UNIFORM_SIZE 1
92 active uniform s.s2.a GL_UNIFORM_OFFSET 24
93 active uniform s.s2.a GL_UNIFORM_ARRAY_STRIDE 0
94 active uniform s.s2.a GL_UNIFORM_MATRIX_STRIDE 0
95 active uniform s.s2.a GL_UNIFORM_IS_ROW_MAJOR 0
97 uniform float s.s2.g 3.3
100 probe all rgba 0.0 1.0 0.0 1.0