title: Writing to gl_FragColor causes INVALID_OPERATION on Android
body: <p>I'm trying to master OGLES2 for NDK and stuck with GLSL shaders. The situation is similar to <a href="https://stackoverflow.com/questions/15456880/writing-to-gl-fragcolor-causes-gluseprogram-to-throw-gl-invalid-operation">the one already highlighted here</a>, but it seems the reason behind it is somewhat different.</p>
  
  <p>I have the simpliest shaders possible.</p>
  
  
  
  <h3>Vertex:</h3>
  
  <pre class="lang-c prettyprint-override"><code>#version 110
  attribute vec3 vPosition;
  void main(void)
  {
      gl_Position = vec4(vPosition, 1.0);
      gl_FrontColor = gl_BackColor = vec4(0.3, 0.3, 0.3, 1); // ***
  }
  </code></pre>
  
  <h3>Fragment:</h3>
  
  <pre class="lang-c prettyprint-override"><code>#version 110
  void main(void)
  {
      gl_FragColor = gl_Color;
  }
  </code></pre>
  
  <p>Easy and straight-forward. I even define my triangles straight in the clip space.
  The starred(<code>***</code>) line in the VS source makes the <code>glUseProgram</code> call to throw the <code>GL_INVALID_OPERATION</code> error (and all subsequent <code>glGetAttribLocation</code> calls do the same) when I run the app on my Android 403 device. I can write to <code>gl_FragColor</code> in FS (some hardcoded <code>vec4</code> value), but can't even touch the <code>gl_FrontColor</code>/<code>gl_BackColor</code> values in VS.</p>
  
  <pre class="lang-c prettyprint-override"><code>E/Adreno200-ES20(16211): &lt;qgl2DrvAPI_glUseProgram:1344&gt;: GL_INVALID_OPERATION
  E/Adreno200-ES20(16211): &lt;qgl2DrvAPI_glGetAttribLocation:531&gt;: GL_INVALID_OPERATION
  </code></pre>
  
  <p>I check every possible error (<code>glGetError</code> and <code>glGetShaderInfoLog</code>) during shader compilation and linkage, everything is clear there.</p>
  
  <p>The application works fine on windows when I switch my OGL implementation to a JOGL one (all the bootstrapping and rendering code remains the same). I can use even a vertex attributes containing a color, no problems at all.</p>
  
  <p>Is there a way to fix this behaviour? I don't believe Android OGLES implementation is <em>that</em> sick, probably I'm just missing some of its <em>features</em>...</p>