Skip to main content
GameDev.net gamedev.net
🔒 Locked

ATI & framebuffer performance

Started by derodo Jun 28, 2006 at 6:56 PM 5 replies 1.6k views
Original Post
derodo
derodo
Hi there, This time I'm playing with the framebuffer object extension, trying to render to an off-screen floating point buffer...everything seems to be working fine with my nVidia card (GF7800), but if I run the same application on my ATI-based PC (9700Pro), then the framerate drops drastically to less than 1 frame per second. After a bit of trial and error I found quite some interesting facts: 1) The best internal format to be used for floating point targets is GL_RGB_FLOATxx_ATI (16 or 32 bits), as the "standard" GL_RGBxxF_ARB is not supported by ATI until the X800 series and above...so it is no so standard :P 2) My GeF7800 does not support 32bits floating point framebuffers if the render target is a texture; it only works if its a render buffer (glCheckFrameBufferStatus fails) 3) My GeF7800 does not support 16 bit depth buffers (glCheckFrameBufferStatus fails) 4) The ATI problem dissapears if I use a plain 8bit color RGB framebuffer. Besides that, I've traced my application and found that the problem is caused only if I perform a glClear(GL_DEPTH_BUFFER_BIT) once the floating point buffer is bound and fully working (the glCheckFrameBufferStatusEXT says so at least). If I do not clear the depth buffer, the applications runs smoothly on both ATI and nVidia, but if just uncommet that damn line, then I start getting 1FPS or less on ATI...oh! and listen to this: the more bits the depth buffer has, the worse it runs...I mean, if i attach a 16bits depth buffer, then it runs at, lets say 1FPS, but if I attach a 24bit one, then it runs at 0.5FPS... With the nVidia configuration, it always works (as long as I use 16bit FP color render targets and 24bit depth targets). Anyone knows what the hell is going on? I'm kinda lost now. Could it be a problem with the ATI drivers? I have googled the problem, but didnt find anything about this... I'd appreciate some comments on this. Thanks in advance,
MARS_999
MARS_999
x800 doesn't support 24bit depth textures only 16. As for your issues with the depth clear bit, I remember reading about this somewhere else and not sure why it was but it must be an issue for I seen it before...
derodo
derodo
I think it has something to do with the interaction of the depth buffer and the floating point color buffer, as if I change any of them the application runs smoothly again.

I mean:
RGB texture + depth renderbuffer=OK (
RGB_FP16 texture = OK
depth renderbuffer = OK
RGB_FP16 rexture + depth renderbuffer=FAIL

Maybe I should try using a texture target for the depth buffer instead of a renderbuffer. I have also checked that using a color renderbuffer instead of a texture yields the same results.

If anyone finds anything than can help...
zimerman
zimerman
What about clearing the depth buffer this way ?:

glEnable(GL_DEPTH_TEST);glDepthFunc(GL_ALWAYS);glDepthRange(1, 1);glDepthMask(GL_TRUE);glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);// draw some quad covering the whole viewport...
derodo
derodo
I've tested the tricky method you propose to clear the depth buffer, but its the same...or even worse...it keeps running fine on my nVidia card, but runs even slower on my ATI...far less than 0.5FPS...

Don't know what the hell is going on...I must be doing something completely wrong, but cant find it...I've even removed all unnecesary lines of code, but its allways the same: complete desaster on my Radeon 9700Pro.

I'll keep investigating...
derodo
derodo
Hi again,

Still having the problem, but gathered some more info...i've been able to speed up the application to 22FPS on my ATI 9700...it may seem OK, but the fact is I'm rendering NOTHING in the framebuffer, just clearing the GL_DEPTH_BUFFER_BIT; I'm not even displaying its contents, I just render a couple of textured primitives to the system framebuffer to show the framerate...

I know the framerate is not a good measure, I'm just dispplaying it to compare the performance changes...in the nVidia 7800 it shows about 2000FPS...the same rate it shows in ATI if I just use a plain 8bit RGB color texture for the framebuffer instead of a FP16 one.

I donwloaded an HDR demo from humus.ca, that is doing the same (FP16 texture color buffer+16bit depth renderbuffer) and works perfectly. I've even compiled it and debugged in VS to check the GL calls are the same as mine (you know, framebuffer generation, renderbuffers, etc.)...and they seem to be the same :(

I'm running out of ideas...could it be there some GL state I'm forgetting?
derodo
derodo
Hi again!

I've finally found the problem. It is absolutely crazy, but the fact is that on my Radeon 9700Pro, having the alpha blending enabled while calling glClear(GL_DEPTH_BUFFER_BIT) completly ruined the GPU performance.

Don't ask me why, but after I went out of "logic" ideas, and finding out some demos doing the same flawlessly, I started to think It had something to do with a "wrong" GL state...

So I decided to clear all states to "default", and after a little trial and error, I isolated the problem. It was the damn alpha blending!

Just wanted you to know :)

Thaks for your kind support,

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.