gnash-dev
[Top][All Lists]
Advanced

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

Re: [Gnash-dev] Vblank sync and double buffering


From: Bastiaan Jacques
Subject: Re: [Gnash-dev] Vblank sync and double buffering
Date: Tue, 26 Aug 2008 14:25:23 -0700 (PDT)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)


On Tue, 26 Aug 2008, Michael McTernan wrote:
I've been trying to use gnash with the openGL renderer to get some smooth
graphics.  I managed to do this building 0.8.3 from source with some changes
to fix some problems I found on the way:

1) GtkGlExtGlue::init() may fail to get a double buffered context.

This function first attempts to get a context with
GDK_GL_MODE_RGB | GDK_GL_MODE_STENCIL | GDK_GL_MODE_DOUBLE |
GDK_GL_MODE_ACCUM.  If this fails (which it does for my Radeon based setup)
it goes on to get a context with just GDK_GL_MODE_RGB | GDK_GL_MODE_DEPTH.
The problem here is that the render_handler_ogl::end_display() clears then
redraws the screen *8* times in a row leading to really bad flickering and
tearing.   It's trying to do antialiasing via the accumulation buffer, but
since we don't have one and only a single buffer this just adds visual
discomfort.

I agree, we have to adjust the end_display() issues to match the
initialization code in GtkGlExtGlue. But this is pointing to a more
complicated issue, namely that we should have a clear fallback path for
OpenGL anti-aliasing implementation differences (of which there are many).
Ideally, we should a) support all mainstream anti-aliasing methods, b)
try to detect which methods are available and c) Make the anti-aliasing
methods configurable in the GUI in cases where automatic detection does
not work correctly (very likely, depending on your hardware). I've
already taken a stab at a) when I was working on porting Gnash to OS X.

I will be resuming this work shortly, hopefully to be completed before
the release.

2) GtkGlExtGlue::render() doesn't vsync.

I'm not sure why gdk_gl_drawable_swap_buffers() doesn't wait for a vsync,
but it doesn't under my setup.  I forced vsync on using driconf and this
verifiably works for GL based apps (e.g. glxgears FPS=60), but isn't doing
it for gnash.  I suspect a GLX pixmap is being used and preventing direct
rendering and hence sync, but not sure.  In anycase, I modified the function
to use gdk_gl_glXWaitVideoSyncSGI():

Great, would you be willing to provide this part in a diff format to
make it easier for other people to try?

Thanks for your debugging efforts!

Bastiaan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]