glCopyTexSubImage3D issue with mutlisample FBO

I am updating an application to use a full-screen FBO as its render-target, under an OpenGL 3.2 context with Nvidia 306.97 drivers and a gtx680m.

Some previously working code is now generated a GL_INVALID_OPERATION error:

[Error] from OpenGL with Severity: High – ID: 1282
Message: GL_INVALID_OPERATION error generated. Copy is invalid when anti-aliasing is enabled on the current read buffer.

The code this leads me to (up the stack from our debug callback) is:


glBindTexture( GL_TEXTURE_2D_ARRAY, texture_d )

glCopyTexSubImage3D( GL_TEXTURE_2D_ARRAY, miplevel, 0, 0, layer, SUBLOAD_OFFSET, SUBLOAD_OFFSET, RESOLUTION >> miplevel, RESOLUTION >> miplevel );

glBindTexture( GL_TEXTURE_2D_ARRAY, 0 );

From the documentation the only time I can see that an invalid operation should be generated is in the case that the texture has not been allocated with a call to glTexImage3D which I have verified via gdebugger.

Has anyone else run into this issue? Is it a driver bug, or am I missing something else?

Upon re-reading the specification I noticed that glCopyTexSubImage3D performs its copy as if glReadPixels had been called, and glReadPixels will in fact generate an invalid operation in the case that I mentioned above.

For others’ reference in the future the case is the following:

        GL_INVALID_OPERATION is generated if GL_READ_FRAMEBUFFER_BINDING
        is non-zero, the read framebuffer is complete, and the value of GL_SAMPLE_BUFFERS
        for the read framebuffer is greater than zero.