I am rendering a scene in OpenGL in a low resolution into a framebuffer. Then I intend to draw this version onto the whole screen (upscaled with GL_NEAREST). I do this using texture blitting (glBlitFramebuffer). On my Nvidia GPU this works, but when executing the exact same code on my Intel i7 integrated Graphics, the y-Position on the target framebuffer seems wrong (i.e. the image is rendered too far up).
glGetError returns no error. As the Nvidia driver tends to be very forgiving, I expect that I am missing a minor detail in the OpenGL spec that Nvidia doesn't care about. I searched the internet and stackoverflow and couldn't find a similar problem described. Both drivers report to support OpenGL 3.0
My drawing code:
//setup viewport for small image
glPushAttrib(GL_VIEWPORT_BIT);
glViewport(0, 0, image.getWidth(), image.getHeight());
//bind small framebuffer
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
glDrawBuffers(GL_COLOR_ATTACHMENT0);
glClear(GL_COLOR_BUFFER_BIT);
//draw
renderRotatedFull(1);//nothing interesting at all happening here
//reset Viewport
glPopAttrib();
//prepare and execute blitting
glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo);
glReadBuffer(GL_COLOR_ATTACHMENT0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glDrawBuffers(GL_BACK_LEFT);
glBlitFramebuffer(0, 0, image.getWidth(), image.getHeight(), 0, 0, Game.width,
Game.height, GL_COLOR_BUFFER_BIT, GL_NEAREST);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
//throws exception if there is an OpenGL error
org.lwjgl.opengl.Util.checkGLError();
Initialisation is done as follows:
fbo =glGenFramebuffers();
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
rbo = glGenRenderbuffers();
glBindRenderbuffer(GL_RENDERBUFFER, rbo);
glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8, image.getWidth(), image.getHeight());
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rbo);
assert(glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE);