     /* This lets us avoid having to fiddle with viewports or viewport arrays */
     gl_ClipDistance[0] = dot(gl_Position,clipPlane);
 
+#ifdef ARB_cull_distance
     /* TODO: Fix culling, this could be important for perf */
     gl_CullDistance[0] = 1.0;
+#endif
 }

#version 330 core

layout(location=0)in vec3 pos;
layout(location=1)in vec2 tex;

out gl_PerVertex{
    vec4 gl_Position;
    float gl_ClipDistance[1];
#ifdef ARB_cull_distance
    float gl_CullDistance[1];
#endif
};
out VS_OUT{
    vec2 tc;
