title: GLSL: will assignment from an uniform to never modified variable cause copying?
body: <p>I am optimizing <code>glUniform</code> calls count. In some shader I have lots of vec2 uniform variables.</p>
  
  <p>Initially their declarations looked like</p>
  
  <pre class="lang-c prettyprint-override"><code>uniform vec2 foo;
  uniform vec2 bar;
  ...
  </code></pre>
  
  <p>After optimizing I declared the following:</p>
  
  <pre class="lang-c prettyprint-override"><code>uniform vec2 v2params[42];
  vec2 foo = v2params[0];
  vec2 bar = v2params[0];
  ...
  </code></pre>
  
  <p>GLSL 130 does not allow to qualify <code>foo, bar, ...</code> as <code>const</code> in this case, but they are never modified in further code.</p>
  
  <p>Will modern GLSL compilers guess their constness and eliminate copying? Or should I use values like <code>v2params[0]</code> instead of <code>foo</code> to ensure absence of copying? The latter will significantly decrease code readability.</p>
  
  <p>PS. I'm restricted to OpenGL 2 and WebGL 1, so UBOs are not available.</p>