title: error 0x0502 when reading pixels to PBO from FBO
body: <p>I was trying to use FBO and PBO together, read pixels from FBO to PBO, everyframe.
  Codes are below:</p>
  
  <pre><code>//at the beginning:
  //fbo
  glGenFramebuffers(1, &amp;m_fBO);
  glBindFramebuffer(GL_FRAMEBUFFER, m_fBO);
  glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texid, 0);
  //pbo
  glGenBuffersARB(1, &amp;m_pbo);
  glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, m_pbo);
  glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, DATA_SIZE, 0, GL_STREAM_READ_ARB);
  
  //at each frame:
  glBindFramebuffer(GL_FRAMEBUFFER, m_fBO);
  Draw_some_stuff();
  glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, m_pbo);
  glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
  glPixelStorei(GL_PACK_ALIGNMENT, 1);
  glReadPixels(0, 0, m_width, m_height, GL_RGBA, GL_UNSIGNED_BYTE, 0);   //err occurs
  Ptr = glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY_ARB);
  Cpu_works_on_Ptr();
  glUnmapBufferARB(GL_PIXEL_PACK_BUFFER_ARB);
  </code></pre>
  
  <p>It works fine on PC. But failed to running on my android phone, got an error 0x0502(GL_INVALID_OPERATION) right after glReadPixels.</p>
  
  <p>I believe my codes are the same as the bottom answer at this link: 
  <a href="https://stackoverflow.com/questions/6144268/reading-the-pixels-values-from-the-frame-buffer-object-fbo-using-pixel-buffer">Reading the pixels values from the Frame Buffer Object (FBO) using Pixel Buffer Object (PBO)</a></p>
  
  <p>Has anyone got a clue? Where did I do it wrong?</p>