glBlitFramebuffer between multisample FBO (source) and simple FBO (destination) to resolve multisamp

Hi there,

I am writing a code to resolve automatically the multisampling from one FBO (with multiple color attachements - MS textures) to another FBO (with the same color attachements - simple textures).

When applying this method to blit from one simple FBO to another (with same color attachements) it works perfectly well !
But when I just change the source FBO to a multisampled one (with multisampled textures), blitting is not resolved (but no error is detected using glGetError after the glBlitFramebuffer function).

Does anyone have any idea ?
I activated the “GL_MULTISAMPLE” state and my multisampled FBO / textures have 4 samples too.
(I set my window with 1 sample buffer with 4 samples (but it should not have any incidence while blitting)

void resolve()
{

	glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fboSrcID);
	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_fboDstID);

	// there are 2 color attachements (textures)
	for(unsigned int i = 0 ; i < 2; i++)
	{
		glReadBuffer(GL_COLOR_ATTACHMENT0+i);
		glDrawBuffer(GL_COLOR_ATTACHMENT0+i);
		glBlitFramebuffer(0,0,1024,1024,0,0,1024,1024,GL_COLOR_BUFFER_BIT, GL_NEAREST);
		GLenum err = glGetError();
		if(err!=GL_NO_ERROR)
		{
			printf("Error while blitting\n");
		}

	}
  
	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);

}

Ohoh ! … I did a really bad “copy/paste” writting and my MS FBO had single textures attached instead of MS textures !
Everything is fixed and works pretty well. But I still have a performance issue : I did MS to improve the framerate dividing the texture resolution by 2.
==> It seems to be a bit slower using MS with 2048x2048 textures than doing the rendering directly in 4096x4096. If someone has an idea, feel free to advise me ;) (I should look at the video driver configuration to be sure it is the NVidia board who is doing the job … since I work on a laptop)
UPDATE : INTEL board is used instead of NVidia’s while launching from Visual Studio … with NVidia, framerate using MSAA on 2048x2048 (with 4 samples) is nearly twice the framerate for 4096x4096 without MS !