1// Test that inputs and outputs are assigned the correct location when using 2// interface blocks and explicit locations. 3 4[require] 5GLSL >= 1.50 6GL_ARB_separate_shader_objects 7 8[vertex shader] 9#version 150 10#extension GL_ARB_separate_shader_objects: require 11 12in vec4 piglit_vertex; 13 14layout(location = 0) out block { 15 vec4 a; 16} name; 17 18layout(location = 2) out block2 { 19 vec4 a; 20} name2; 21 22void main() 23{ 24 name.a = vec4(0.0, 1.0, 1.0, 1.0); 25 name2.a = vec4(1.0, 0.0, 0.0, 1.0); 26 27 gl_Position = piglit_vertex; 28} 29 30[fragment shader] 31#version 150 32#extension GL_ARB_separate_shader_objects: require 33 34layout(location = 2) in block { 35 vec4 a; 36} name; 37 38layout(location = 0) in block2 { 39 vec4 a; 40} name2; 41 42out vec4 color; 43 44void main() 45{ 46 color = name.a; 47} 48 49[test] 50draw rect -1 -1 2 2 51probe all rgb 1 0 0 52