Hi, I'm copying textures using glBlitFramebuffer like this:
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, src->handle(), 0);
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, dst->handle(), 0);
glBlitFramebuffer(0, 0, src->size().x, src->size().y, 0, 0, dst->size().x, dst->size().y, GL_COLOR_BUFFER_BIT, mode);
The framebuffer is freshly created and has no other attachments. src is 512x512 and dst is 256x256 and mode is set to linear filtering.
I got an error callback that says
GL_INVALID_FRAMEBUFFER_OPERATION error generated. Framebuffer bindings are not framebuffer complete.
So after setting the attachments I checked both READ and WRITE fb with glCheckFramebufferStatus. The WRITE fb returns GL_FRAMEBUFFER_COMPLETE, but to my surprise the READ fb returns GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT (I'm not even using this old extension).
I managed to workaround the issue by first setting src attachment to both READ and DRAW fb and then replacing the draw:
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, src->handle(), 0);
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, dst->handle(), 0);
but this seems unnecessary to me. The curious thing is that if I first set both buffers to dst and then change only READ I still get the error in the READ fb.
I'm using OpenGL 4.5 context (beta NVidia driver on GTX780).
I thought I should be able to set READ and WRITE buffers to different dimensions since OpenGL 3.something without such issues?
Could this be a driver bug or am I missing something about the framebuffer setup?