Weston framerate (Re: bare bones opengl weston client sample)
ppaalanen at gmail.com
Tue Sep 18 01:50:42 PDT 2012
On Fri, 14 Sep 2012 10:32:03 -0400
jegde jedge <bubbah.t at gmail.com> wrote:
> Sorry about the delay.
> I flew 8 legs in 4 days this week.
> Here are the mains for both the glut and Wayland instance of my test
> uMfdInit, uMfdDraw, and c->controller->event() are the interface
> functions, solely used by both implementations.
> The code under the hood is IDENTICAL. (with the exception of
> glutPostRedisplay() for pan gestures.)
> In MainWayland you will see simple-egl.c conditionally compiled for my
> application using
> HAVE_GLES2 and SIMPLE_EGL
> Both MainWayland.c and MainGlut.c use the functions above in the same way.
> To recap I am hoping to allow unbounded redraws for testing purposes only.
I don't think Mesa implements that for Wayland windows yet. You might
be able to get it by using some vsync related extensions, but by
default, you will be capped to the monitor refresh rate anyway, as
eglSwapBuffers will block.
Remember, that your repaint loop is (must be, to avoid a deadlock in
Mesa!) driven by the frame callback, which you will get only after a
flip (monitor refresh). That alone limits you to monitor refresh rate.
IOW, you must not call redraw() until you have received the frame
callback set in the previous redraw (I tried to explain this earlier,
and it is the key to fluent rendering for now).
If you want uncapped, better render to FBO or pbuffer.
All the #ifdefs really make it hard to read.
You seem to be getting a NULL 'window' in some functions, that should
Other than that, I couldn't see a real problem in the middle of all
that. Are you also sure, that the code you pasted below is the only
place to ever call eglSwapBuffers()?
> static void
> redraw(void *data, struct wl_callback *callback, uint32_t time)
> struct window *window = data;
> struct wl_region *region;
> if (callback)
> if (window)
> if (!window->configured)
> eglSwapBuffers(window->display->egl.dpy, window->egl_surface);
> if (window)
> window->callback = wl_surface_frame(window->surface);
> wl_callback_add_listener(window->callback, &frame_listener, window);
If you ever get here with window=NULL, a new frame callback is not
requested, therefore there is nothing to trigger rendering anymore. You
are not rendering in a continuous loop. In fact, I'm suprised your
application renders more than one frame ever, if window=NULL.
I hope these comments give you some ideas where to look.
More information about the wayland-devel