[SDL] OpenGL speed, Linux vs W2000

Gib Bogle bogle at ihug.co.nz
Thu Jan 23 12:38:01 PST 2003


> Message: 16
> Date: Wed, 22 Jan 2003 19:14:21 -0500
> From: Glenn Maynard <g_sdl at zewt.org>
> To: sdl at libsdl.org
> Subject: Re: [SDL] OpenGL speed, Linux vs W2000
> Reply-To: sdl at libsdl.org
> 
> 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).

Very interesting.  If I remove both SDL_FULLSCREEN and SDL_NOFRAME from
video_flags in the W2000 version I get 690 fps.  Removes either one
alone has no effect.  Do you think this means there might be a Linux
bug, and do you mean in SDL or X?

Now I have to correct a previous statement I made.  I now realize from
looking at the output from the program that the W2000 version always
sets SDL_GL_DEPTH_SIZE to 16, while the Linux version sets it to 24,
regardless of what I try to set it at (16 or 24).  The call
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, n) seems to be redundant -
commenting it out has no effect.

Gib




More information about the SDL mailing list