[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: X11 speed (was Re: Interested in starting some basic development)



Borko Jandras wrote:
> 
> On Thu, Nov 19, 1998 at 08:31:32AM +0100, Jorrit Tyberghein wrote:
> 
> > > X? I did a very simple test. Opened up a 640x480 window and drawed a rectangle
> > > across it, using Mesa. It took cca. 150 milliseconds for each frame.
> > > Let me spare you the calculation, that's 6.6 fps. Can you live with that?
> > > Oh yes, the machine was K6-2 333. X just isn't made for such things.
> >
> > Crystal Space (yes that ugly C++ library of mine :-) runs with the following
> > speeds in X with a 640x480 window (16-bit display mode):
> >     My old pentium 90: 10 FPS
> >     My new P-II 400: 27 FPS
> >
> > And you have to keep in mind that it also has to do some rendering instead
> > of only blitting to the screen.
> 
> Thit is better than what I get, but is still not enough. I don't know what kind
> of rendering CS does, but I would expect 10 fps on 486DX2-66.

Why? Quake couldn't even do that well. Not on a 486DX2. It could do
10-15 on my Pentium/60. But that was at 320x200 or 360x400. Not 640x480.

> 
> > You just have to use the SHM extension (shared memory extension).
> > This helps a VERY GREAT deal. With that extension you get almost the
> > same speeds as with svgalib but without the suid problems.
> 
> I'm using SHM, that is Mesa is using it. Why is it so crappy then? How am I to
> make a decent game for Linux if you need K6-2 to play it.

Mesa isn't exactly noted for its nail-you-to-the-wall speed in software
3D acceleration. Even Microsoft's software renderer is better than that.
To realize the potential of Mesa you need a 3D accelerator. Using X SHM
and the GAMES Sprite32 library I can get around 36 - 40 FPS at 320x200
with a Cyrix 6x86MX-200 which really isn't too bad. My machine could
pull up to 20-25 FPS using pixmaps back when it was a Pentium/60 with an
el cheapo Cirrus Logic GD5434 accel and in a 400x300 window. XSHM is a
good choice to use for most action games and is used most often in
emulators. For real blistering speed, however, something like the DGA,
svgalib or fbcon (which is slowly seeing hardware accel trickle into it)
is necessary.

There is a trade-off to be made here. If you are doing something that
requires fine pixel-level control (for example, a software 3D rendering
engine, alpha blending, morphing, rotating, etc.) then a way to get at
the memory that contains the framebuffer is necessary and XSHM provides
this. If, however, you're simply throwing a bunch of predefined shapes
on the screen (and many 2D games fit this well) you can get a speed
boost by using a mechanism such as Pixmap-based rendering (or, if you're
a real DirectX weenie, off-screen Surfaces) as hardware accel will be
used to accomplish this task.

-- 
----------------------------------------------------------------------
Jeff Read <bitwize@geocities.com>/ http://genpc.home.ml.org
Unix / Linux / Windows Hacker,  / Boycott Microsoft!
Anime & Sonic Fan,             / Use Linux/GNU!
All Around Nice Guy           / Let's keep the Net and the Land FREE!
----------------------------------------------------------------------