title: OpenGL uniform array of structures
body: <p>So i have a custom structure in the fragment shader and an uniform variable that is an array of these structures. It is defined like this:</p>
  
  <pre><code>#version 130
  #define MAX_LIGHTS 8
  
  struct Light {
      vec3 ambient;
      vec3 diffuse;
      vec3 specular;
      vec4 position;
      vec3 direction;
      float cutoff;
      float exponent;
  };
  
  uniform Light lights[MAX_LIGHTS];
  </code></pre>
  
  <p>Now, i'm trying to get the uniform locations like this:</p>
  
  <pre><code>glGetUniformLocation(program, "lights[0].ambient");
  glGetUniformLocation(program, "lights[0].diffuse");
  // etc...
  </code></pre>
  
  <p>Everything works fine on my GTX460, but the <code>glGetUniformLocation</code> returns -1 on a Mobility Radeon HD 5650 even though the shader compiles/links fine and everything. (It is an OpenGL 3.1 context btw.)</p>
  
  <p>What am i doing wrong?</p>
  
  <p><strong>EDIT</strong>: Alright, <a href="http://pastebin.com/jnSqEKW5" rel="nofollow">here</a> is the full shader (i did not write it, i'm trying to fix a friend's program). Additionally, i have also tested this on an Intel HD integrated graphics adapter and it worked without problems as well.</p>