mesa: move GL_INVALID_OPERATION error to rendering call