[SDL] OpenGL speed, Linux vs W2000

Glenn Maynard g_sdl at zewt.org
Wed Jan 22 16:15:00 PST 2003


On Thu, Jan 23, 2003 at 12:19:03PM +1300, Gib Bogle wrote:
> The SDL test program testgl.c gives quite different execution speeds on
> Linux and W2000 on my system (P4, GF4 Ti).  Running flat out in 1024x768
> fullscreen, bpp=24, Linux gives 620 fps, while W2000 gives 1550 fps.  It
> seems that the difference is in SDL_GL_SwapBuffers().  Commenting that
> out pushes the Linux version up to 1650 fps.  (I think W2000 gives
> something similar, but the program doesn't like to run with buffer swap
> suppressed.  When run from a 
> Command Prompt window it returns quickly to the command prompt but the
> process continues to execute.  This odd behaviour might be of interest
> to someone.)
> 
> I realize that 620 vs 1550 fps is actually rather academic, since it
> represents only an extra 0.1 ms per frame, but nonetheless I'm curious
> to know why swapping buffers with W2000 is faster than with Linux, since
> I think this is happening on the video card.

See what happens if you use a 1024x768 window in Windows.  Linux might
be blitting on flip instead of page flipping (which would be a bug).

> I've seen this sort of symptom on machines with different video cards and
> drivers, but with the same OS.  I think it occurs because one of the
> machines (the 2000 machine, in your case), is not waiting for the vsync
> on a SwapBuffers call - as you say, when it is commented out on the other
> machine, you get about the same frame rate (disregarding small OS
> specific performance differences).

It's not a vsync problem--both configurations have vsync entirely disabled,
since he's testing the speed of the actual flip.  (Unless he has a
monitor that can do 620Hz in 1024x768, which I'm sure he doesn't.  :)

-- 
Glenn Maynard




More information about the SDL mailing list