Newer versions of Movit clear the FBO attachment after rendering to an FBO
(so that it's harder to accidentally attach to the same FBO from multiple
threads), so we need to explicitly choose one to read from.
render_fbo( service, chain, fbo->fbo, width, height );
// Read FBO into PBO
render_fbo( service, chain, fbo->fbo, width, height );
// Read FBO into PBO
+ glBindFramebuffer( GL_FRAMEBUFFER, fbo->fbo );
+ check_error();
glBindBuffer( GL_PIXEL_PACK_BUFFER_ARB, pbo->pbo );
check_error();
glBufferData( GL_PIXEL_PACK_BUFFER_ARB, img_size, NULL, GL_STREAM_READ );
glBindBuffer( GL_PIXEL_PACK_BUFFER_ARB, pbo->pbo );
check_error();
glBufferData( GL_PIXEL_PACK_BUFFER_ARB, img_size, NULL, GL_STREAM_READ );