glBlitFramebufferEXT is killing my FPS

Started by
-1 comments, last by xilup 14 years ago
I'm rendering my scene to a multisampled framebuffer and then i blit it to thw window's default framebuffer.The problem is that it's killing my FPS, it mvoes really slowly.Overall it works, i have a multisampled image on the screen but it moves to slow. Is it because of my hardware, or i did something wrong?

void 
COpenGLDriver::BeginScene()
{
	if(lpScreen)
		lpScreen->HandleScreen();
	glClearColor(0,0,1,1);
	glClear(GL_COLOR_BUFFER_BIT);
	lpExtension->glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mFrame);
}

void 
COpenGLDriver::EndScene()
{
	lpExtension->glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, NULL);
}

void 
COpenGLDriver::Present(RECT *lpSrcRect, RECT *lpDstRect)
{
	LQSCREENDATA mData;
	lpScreen->GetScreenData(&mData);
	
	lpExtension->glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, mFrame);
	lpExtension->glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, NULL);
	lpExtension->glBlitFramebufferEXT(
		lpSrcRect ? lpSrcRect->left : 0, lpSrcRect ? lpSrcRect->top : 0,
		lpSrcRect ? lpSrcRect->right : mData.mWidth, 
		lpSrcRect ? lpSrcRect->bottom : mData.mHeight,
		lpDstRect ? lpDstRect->left : 0, lpDstRect ? lpDstRect->top : 0,
		lpDstRect ? lpDstRect->right : mData.mWidth,
		lpDstRect ? lpDstRect->bottom : mData.mHeight,
		GL_COLOR_BUFFER_BIT, //I removed the depth and stencil buffer,        //it moves a bit faster, but in full screen mode FPS go really low.
		GL_NEAREST); //I also tried GL_LINEAR, same thing
	lpExtension->glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, NULL);
	lpExtension->glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, NULL);
	
	SwapBuffers(mData.hDC);
}
If i blit from a non-multisampled framebuffer to the default framebuffer, it is just a little bit faster, hardly noticeable.

This topic is closed to new replies.

Advertisement