title: GLSL Shader will not render color from uniform variable
body: <p>I am currently building an app for Android, but have run into some problems with a shader that refuses to render.  </p>
  
  <p>Consider the following fragment shader:</p>
  
  <pre><code>uniform vec4 color;
  void main(){
      gl_FragColor = vec4(1.0);
  }
  </code></pre>
  
  <p>This shader works fine for drawing an object in a solid color (white in this case). The uniform vector <code>color</code> is optimized away, and cannot be found with <code>glGetUniformLocation()</code> (returns -1).</p>
  
  <p>Trying to get the color from the uniform variable can be done like so:</p>
  
  <pre><code>uniform vec4 color;
  void main(){
      gl_FragColor = color;
  }
  </code></pre>
  
  <p>However, when I use this, nothing renders. The shader is created successfully and <code>glGetUniformLocation()</code> returns a valid value (0) for color. But nothing shows on screen, not even black. The only change made is replacing <code>vec4(1.0)</code> with <code>color</code>.
  This code has the same result: </p>
  
  <pre><code>uniform vec4 color;
  void main(){
      gl_FragColor = vec4(1.0)+color;
  }
  </code></pre>
  
  <p>The strange thing is that when I tried the shader in a different project, it works as it should, so the problem must be something I do elsewhere in the code.<br>
  This is my drawing method (keep in mind that it works when the color-variable is not in the shader):</p>
  
  <pre><code>GLES20.glUseProgram(colorshader);
  GLES20.glUniform4f(colorIndex, 1, 1, 1, 1); //colorIndex is the result of glGetUniformLocation() called with the correct shader index and variable name.
  
  Matrix.multiplyMM(mvpMatrix, 0, vpMatrix, 0, matrix, 0);
  GLES20.glUniformMatrix4fv(matrixindex, 1, false, mvpMatrix, 0);
  
  GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, vertices);
  GLES20Fix.glVertexAttribPointer(Shader.ATTRIBUTE_VERTEX, 3, GLES20.GL_FLOAT, false, 12, 0);
  
  GLES20.glLineWidth(width);
  GLES20.GL_UNSIGNED_SHORT, 0);
  GLES20.glDrawArrays(GLES20.GL_LINES, 0, count);
  </code></pre>
  
  <p>I have absolutely no idea what might be causing this odd behaviour, if anyone have any ideas or possible solutions, please help me.</p>
  
  <p><strong>Update:</strong><br>
  It seems that using any uniform variable that is not a sampler causes this behaviour in this (and only this) shader.</p>
  
  <p><strong>Update 2</strong>
  Using <code>glGetError()</code> return error code <code>502: GL_INVALID_OPERATION</code>.</p>