|
SDL_GL_Swapbuffers() performance issue
I have a rather simple scene set up as a test bed for my camera system. It consists of a transparent floor, with a couple of crates on the top, as well as their reflections underneath.
This runs at an appalling ~40 fps on my p3 700mhz, GeForce DDR Linux box at 800*600*32. Id expect atleast twice that framerate, probably considerably more. A more complex scene renders at 120+ fps at the same resolution in an older program. Both programs use essentially the same base code which lhas me utterly confused.
I set up a simple timer with SDL_GetTicks() to time the execution of various parts of the main loop. Apparently almost all of the roughly 25ms per frame is spent in SDL_GL_SwapBuffers().In the other program described, SDL_GL_SwapBuffers() completes nearly instantaneously, 0 - 1 ms.
As I was writing this, it came to me that perhaps OpenGL calls are simply qued, and then sent to the X server in the buffer swap call. But if this were an issue, I think a particle system pushing 2000 blended particles with an inverse square based gravity system would run considerably slower than some cubes and a floor.
Since it is very much relevant, here is my window creation code:
I am getting a software blitter (i''d imagine a hardware blitter exists) and a hardware surface, which might explain the sluggish performance, but the other program described also had a software blitter.
I''m completely lost. All ideas appreciated.
January 21, 2002 01:33 PM
quote:
pparently almost all of the roughly 25ms per frame is spent in SDL_GL_SwapBuffers().In the other program described, SDL_GL_SwapBuffers() completes nearly instantaneously, 0 - 1 ms
Sounds very much like a vsync issue.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement