PDA

View Full Version : Perfomance lost after rendering to MRT on ATI



SKoder
04-15-2006, 02:50 PM
I'am attaching two textures to a framebuffer object. Then I call glDrawBuffers(2, ...)
After that I render to this FBO, and disable it.
But all further rendering become 5-10 times slower.

What might be the problem?
Video: R9800pro

SKoder
04-16-2006, 01:34 AM
Framebuffer setup:

...
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBO);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, tex1, 0);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_TEXTURE_2D, tex2, 0);
glDrawBuffersARB(2, drawBuffers);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depthId);
CheckFramebufferError();//No errorDisable fbo:

glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, 0, 0);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_TEXTURE_2D, 0, 0);
glDrawBuffersARB(1, drawBuffers);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);drawBuffers = {GL_COLOR_ATTACHMENT0_EXT...GL_COLOR_ATTACHMENT3_E XT}

Andrew Adinetz
04-16-2006, 02:34 AM
Are you using the latest drivers? And do you use textures you rendered into to texturize something? If so, are they squares with 2^k size? If they are not squares with the power-of-two size, ATI cards are likely to fall back to software rendering...

SKoder
04-16-2006, 02:52 AM
Yes, textures are 2^k size.
I'am using Catalist 5.10

Andrew Adinetz
04-16-2006, 03:05 AM
First, try downloading the latest ATI drivers (www.ati.com). Second, what is drawBuffers in the call glDrawBuffersARB(1, drawBuffers)? Does it specify the application-defined buffer attachment or GL_BACK_LEFT?

SKoder
04-16-2006, 07:07 AM
I've installed latest drivers, but there isn't any difference.

drawBuffer specify attachements from GL_COLOR_ATTACHMENT0_EXT to GL_COLOR_ATTACHMENT3_EXT

Andrew Adinetz
04-16-2006, 08:34 AM
Does your rendering goes correct after disabling the framebuffer (except for speed)? I mean, there is a possibility of forgetting to turn off shaders, setting incorrect depth tests etc. By the way, what does "5 to 10" times slower mean? Does it refer to the ratio of fps without using framebuffers entirely to fps with using framebuffer?

SKoder
04-17-2006, 12:46 AM
Yes, rendering after that goes correct.
If I just setup and disable FBO speed doesn't fall, but if I render something(or just call glClear(GL_DEPTH_BUFFER_BIT)) all goes much slower.

Render to MRT - always 5ms
Render everything else(without rendering to MRT) - 15ms
Render everything else(+Render to MRT) - 45ms

SKoder
04-18-2006, 10:27 AM
Any ideas?

SKoder
04-18-2006, 12:43 PM
Topic closed, it is a driver issue.