[SDL] OpenGL speed, Linux vs W2000

Glenn Maynard g_sdl at zewt.org
Thu Jan 23 17:10:01 PST 2003


On Fri, Jan 24, 2003 at 02:48:32AM +0200, Sami Näätänen wrote:
> > 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.
> 
> I thought so. ;)
> 
> That's why I asked if you did give the windows version "-bpp 24" 
> parameter so that it will be made 24 bpp like the X11 version.

SDL_GL_DEPTH_SIZE should be irrelevant here; as someone pointed out, it
sets the depth buffer size, not the color buffer.  Just make sure you're
not enabling depth buffering (no glEnable(GL_DEPTH_TEST)) and that you're
not clearing the depth buffer (no glClear(GL_DEPTH_BUFFER_BIT)) for this
benchmark.

But this almost certainly has nothing to do with the difference in
speed.  He's not rendering anything (one poly, did he say?), and when he
forced Windows to buffer-blit instead of buffer-swap, it slowed down to more
or less the speed he's getting in X, so it's most likely a flipping problem
in X, not a bit depth problem.

In fact, the best way to test the speed here is to only call
SDL_GL_SwapBuffers();.  Don't clear the buffers at all, and don't draw
anything.  If you do this, the color buffer depth should also be
irrelevant, at least for determining whether you're getting buffer blits
or buffer swaps.

(Not that it's not a generally good idea to get matching configurations;
I just don't think it's the problem here.)

-- 
Glenn Maynard




More information about the SDL mailing list