2 case mismatch_number_of_declarations
4 desc "Shader storage block mismatch: different number of declarations"
5 require limit "GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS" > 0
6 require limit "GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS" > 0
10 ${VERTEX_DECLARATIONS}
11 layout(binding=0) buffer BufferBlockName
13 mediump float variable1;
16 out mediump float vtx_val;
25 precision mediump float;
26 ${FRAGMENT_DECLARATIONS}
27 layout(binding=0) buffer BufferBlockName
29 mediump float variable1;
30 mediump float variable2;
33 in mediump float vtx_val;
36 ${FRAG_COLOR} = vec4(vtx_val + variable1 + variable2);
43 desc "Shader storage block mismatch: different number of declarations"
44 require limit "GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS" > 0
45 require limit "GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS" > 0
49 ${VERTEX_DECLARATIONS}
50 layout(binding=0) buffer BufferBlockName
52 mediump float variable1;
53 mediump float variable2;
56 out mediump float vtx_val;
59 vtx_val = variable1 + variable2;
65 precision mediump float;
66 ${FRAGMENT_DECLARATIONS}
67 layout(binding=0) buffer BufferBlockName
69 mediump float variable2;
70 mediump float variable1;
73 in mediump float vtx_val;
76 ${FRAG_COLOR} = vec4(vtx_val + variable1 + variable2);
83 desc "Shader storage block mismatch: different number of declarations"
84 require limit "GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS" > 0
85 require limit "GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS" > 0
89 ${VERTEX_DECLARATIONS}
90 layout(binding=0) buffer BufferBlockName
92 mediump vec2 variable;
95 out mediump float vtx_val;
104 precision mediump float;
105 ${FRAGMENT_DECLARATIONS}
106 layout(binding=0) buffer BufferBlockName
108 mediump float variable;
111 in mediump float vtx_val;
114 ${FRAG_COLOR} = vec4(vtx_val + variable);
119 case mismatch_member_name
121 desc "Shader storage block mismatch: different number of declarations"
122 require limit "GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS" > 0
123 require limit "GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS" > 0
127 ${VERTEX_DECLARATIONS}
128 layout(binding=0) buffer BufferBlockName
130 mediump float variable1;
133 out mediump float vtx_val;
142 precision mediump float;
143 ${FRAGMENT_DECLARATIONS}
144 layout(binding=0) buffer BufferBlockName
146 mediump float variable2;
149 in mediump float vtx_val;
152 ${FRAG_COLOR} = vec4(vtx_val + variable2);
157 case mismatch_member_unsized_sized_array
159 desc "Shader storage block mismatch: different number of declarations"
160 require limit "GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS" > 0
161 require limit "GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS" > 0
165 ${VERTEX_DECLARATIONS}
166 layout(binding=0) buffer BufferBlockName
168 mediump float variable[];
171 out mediump float vtx_val;
174 vtx_val = variable[0];
180 precision mediump float;
181 ${FRAGMENT_DECLARATIONS}
182 layout(binding=0) buffer BufferBlockName
184 mediump float variable[1];
187 in mediump float vtx_val;
190 ${FRAG_COLOR} = vec4(vtx_val + variable[0]);
195 case mismatch_member_array_size
197 desc "Shader storage block mismatch: different number of declarations"
198 require limit "GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS" > 0
199 require limit "GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS" > 0
203 ${VERTEX_DECLARATIONS}
204 layout(binding=0) buffer BufferBlockName
206 mediump float variable[1];
209 out mediump float vtx_val;
212 vtx_val = variable[0];
218 precision mediump float;
219 ${FRAGMENT_DECLARATIONS}
220 layout(binding=0) buffer BufferBlockName
222 mediump float variable[2];
225 in mediump float vtx_val;
228 ${FRAG_COLOR} = vec4(vtx_val + variable[0]);
233 case mismatch_with_and_without_instance_name
235 desc "Shader storage block mismatch: different number of declarations"
236 require limit "GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS" > 0
237 require limit "GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS" > 0
241 ${VERTEX_DECLARATIONS}
242 layout(binding=0) buffer BufferBlockName
244 mediump float variable;
247 out mediump float vtx_val;
250 vtx_val = instanceName.variable;
256 precision mediump float;
257 ${FRAGMENT_DECLARATIONS}
258 layout(binding=0) buffer BufferBlockName
260 mediump float variable;
263 in mediump float vtx_val;
266 ${FRAG_COLOR} = vec4(vtx_val + variable);
271 case mismatch_block_array_size
273 desc "Shader storage block mismatch: different number of declarations"
274 require limit "GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS" > 0
275 require limit "GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS" > 0
279 ${VERTEX_DECLARATIONS}
280 layout(binding=0) buffer BufferBlockName
282 mediump float variable;
285 out mediump float vtx_val;
288 vtx_val = instanceName[0].variable;
294 precision mediump float;
295 ${FRAGMENT_DECLARATIONS}
296 layout(binding=0) buffer BufferBlockName
298 mediump float variable;
301 in mediump float vtx_val;
304 ${FRAG_COLOR} = vec4(vtx_val + instanceName[0].variable + instanceName[1].variable);
309 case ambiguous_variable_name_1
311 desc "Unnamed shader storage block variable and global variable with identical names"
312 require limit "GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS" > 0
313 expect compile_or_link_fail
316 ${VERTEX_DECLARATIONS}
318 layout(binding=0) buffer BufferBlockName
320 mediump float variable;
323 out mediump float vtx_val;
332 precision mediump float;
333 ${FRAGMENT_DECLARATIONS}
334 in mediump float vtx_val;
337 ${FRAG_COLOR} = vec4(vtx_val);
342 case ambiguous_variable_name_2
344 desc "Two unnamed shader storage blocks with variables with identical names"
345 require limit "GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS" > 1
346 expect compile_or_link_fail
349 ${VERTEX_DECLARATIONS}
350 layout(binding=0) buffer BufferBlockNameA
352 mediump float variable;
354 layout(binding=1) buffer BufferBlockNameB
356 mediump float variable;
359 out mediump float vtx_val;
368 precision mediump float;
369 ${FRAGMENT_DECLARATIONS}
370 in mediump float vtx_val;
373 ${FRAG_COLOR} = vec4(vtx_val);
378 case ambiguous_variable_name_3
380 desc "Two unnamed shader storage blocks in different stages with variables with identical names"
381 require limit "GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS" > 0
382 require limit "GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS" > 0
383 # language to make link error explicitly defined. ("Within an interface, ...")
384 require extension { "GL_OES_shader_io_blocks" | "GL_EXT_shader_io_blocks" } in { vertex, fragment }
388 ${VERTEX_DECLARATIONS}
389 layout(binding=0) buffer BufferBlockNameA
391 mediump float variable;
394 out mediump float vtx_val;
403 precision mediump float;
404 ${FRAGMENT_DECLARATIONS}
405 layout(binding=1) buffer BufferBlockNameB
407 mediump float variable;
410 in mediump float vtx_val;
413 ${FRAG_COLOR} = vec4(vtx_val + variable);