Whenever I use the ‘flat’ qualifier with the location layout my shaders fail to compile with Catalyst 11.8 on Ubuntu 11.04
#version 410 core
layout(location = 0) in vec3 i_vertex;
layout(location = 1) in vec4 i_perNodeData;
layout(location = 0) flat out int o_instanceID; // fails !
uniform mat4 u_modelViewProjection;
void main()
{
o_instanceID = gl_InstanceID;
vec3 position = i_vertex.xyz*i_perNodeData.w + i_perNodeData.xyz;
gl_Position = u_modelViewProjection * vec4(position,1.0);
}
Log :
Vertex shader failed to compile with the following errors:
ERROR: 0:8: error(#132) Syntax error: 'flat' parse error
ERROR: error(#273) 1 compilation errors. No code generated
The compilation fails in core and compatibility profile.
I’m pretty sure the code is valid for glsl 330 and above though, can someone confirm this is a driver issue?