(Instead, they set up a window the normal way and have the 3D
accelerator render directly into the area occupied by that
window. Fullscreen is done by creating a borderless window of the
right size and then switching the display resolution and
disabling panning and resolution switching shortcuts.)
In X they render to some offscreen video memory location, which
then is clip blitted to the window.
I know some drivers do this all the time, but some do indeed render
directly into the window if you tell them to. ATI’s FireGL drivers
do, obviously, as that’s what I’m using here.
This can be clearly seen if one
runs glxgears without retrace sync in it’s default window size.
Let it run sya 10 seconds after the last output switch to another
desktop for 10 seconds. If you get about double of the seen frame
rate version, then it is simply because the driver needs to blit
the rendered GFX to the X screen.
That tells you whether the card is using true pageflipping or
back->front blits.
True single buffering is a lot easier to detect: If everything that
moves flickers like h*ll, you have single buffering.
Frankly, I don’t think single buffering is useful for anything but
debugging, or as a poor man’s progress indicator when rendering still
images of extremely complex scenes.
This part can be avoided, but
that needs Quatro class HW, because they can render directly to
windows, if the Nvidia driver settings are enabled.
Most cards can render directly into a window, if the driver supports
it. All it takes is changing the frame buffer address and pitch.
However, without hardware support, complex region clipping is going
to be rather slow and awkward to implement.
Dunno’ if a FireGL 8800 has complex region clipping, but the driver
I’m using certainly has a few bugs:
Bug #1: When using single buffering + retrace sync, the maximum
frame rate is half the refresh rate. Seems like each
rectangle takes two retrace syncs…
Bug #2: Looks like every rectangular blit is retrace sync’ed
separately, as the resulting frame rate is exactly the
CRT refresh rate divided by the number of rectangles
needed to draw the partially occluded window. Divide
that by 2 again, in single buffer mode. (2 syncs/rect.)
Bug #3: Rectangle subdivision is suboptimal. A corner of another
window results in 3 rects, while 2 would have been
enough. (Easy to conclude after having spotted the two
bugs above.)
Guess I’ll try the latest driver some time and see if some of this has
been fixed, though it hasn’t annoyed me too much so far… (I don’t
use single buffering, and I don’t have OpenGL windows partially
occluded by other windows when using them.)
I think this same problem persist in all Linux and I think in
Windows drivers as well, because the rendering to window can’t clip
those parts that are covered by another windows.
It sure can (or I’m hallucinating here ;-), but it’s hairy and
possibly slow, unless there’s hardware support for it.
I think I’ll disable retrace sync and do some more tests to see how
the FireGL performs…
Sadly this same condition is still present in the fullscreen in
SDL, because the fullscreen is simply a borderless window. I don’t
know if it could be possible to use randr and get the root windows
gc in fullscreen situations. This would eliminate the need for the
extra blit, but I don’t know if the drivers support this correctly.
Well, all you need is some way of setting up two “windows” and a way
to flip between them…
How about using two single buffered windows and desktop panning (h/w
scrolling)? Requires a desktop big enough to fit two screens of the
desired resolution, but it might actually be possible to do on the
application level, at least with cards that support true single
buffering.
Anyway, that’s just a quick/fun hack, though it demonstrates one of
the issues with XFree86 and drivers that want to do this sort of
stuff; you have one display buffer, and that’s it.
DGA seems to be able to get around that, but I don’t know if it’s of
much help to OpenGL drivers as it is.
//David Olofson - Programmer, Composer, Open Source Advocate
.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
— http://olofson.net — http://www.reologica.se —On Thursday 25 September 2003 21.06, Sami N??t?nen wrote:
On Thursday 25 September 2003 21:08, David Olofson wrote: