From: Stanislav Vorobiov Date: Thu, 21 Nov 2013 10:36:07 +0000 (+0400) Subject: YaGL/VIGS: Return glFinish X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~584^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=151459a5092645cbc26088d61496ce5ff9e1f981;p=sdk%2Femulator%2Fqemu.git YaGL/VIGS: Return glFinish Though we use single host thread for all OpenGL operations it's still not guaranteed that commands in different contexts will be processed in order, thus, single glFinish in VIGS will not wait for GL commands to be processed in YaGL. Because of this contents of windows on target may appear incomplete, this was observed on Mac OS X in particular. glFinish will reduce performance, but it'll ensure correct rendering. Later we'll implement another approach that'll use GL fences in order not to wait for rendering to be completed Change-Id: I4eae90b73f4d66cd8c7fa1939db1c18ad9751051 --- diff --git a/hw/vigs/vigs_gl_backend.c b/hw/vigs/vigs_gl_backend.c index f0f94bf841..dc50908c89 100644 --- a/hw/vigs/vigs_gl_backend.c +++ b/hw/vigs/vigs_gl_backend.c @@ -326,14 +326,6 @@ static void vigs_gl_backend_batch_start(struct vigs_backend *backend) if (!gl_backend->make_current(gl_backend, true)) { VIGS_LOG_CRITICAL("make_current failed"); } - - /* - * Wait until previous rendering is finished. If we don't do this - * then in case if vsync is off many frames will be batched together and - * then flushed once the display is finally updated. This can cause lags - * on some GPUs. - */ - gl_backend->Finish(); } /* @@ -836,6 +828,7 @@ static void vigs_gl_backend_batch_end(struct vigs_backend *backend) { struct vigs_gl_backend *gl_backend = (struct vigs_gl_backend*)backend; + gl_backend->Finish(); gl_backend->make_current(gl_backend, false); } diff --git a/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_surface.c b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_surface.c index 428f7857c5..bd9f2c3534 100644 --- a/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_surface.c +++ b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_surface.c @@ -111,6 +111,10 @@ static bool yagl_egl_onscreen_surface_swap_buffers(struct yagl_eglb_surface *sfc { struct yagl_egl_onscreen_surface *osfc = (struct yagl_egl_onscreen_surface*)sfc; + struct yagl_egl_onscreen *egl_onscreen = + (struct yagl_egl_onscreen*)sfc->dpy->backend; + + egl_onscreen->gles_driver->Finish(); osfc->ws_sfc->base.set_dirty(&osfc->ws_sfc->base); @@ -121,6 +125,10 @@ static bool yagl_egl_onscreen_surface_copy_buffers(struct yagl_eglb_surface *sfc { struct yagl_egl_onscreen_surface *osfc = (struct yagl_egl_onscreen_surface*)sfc; + struct yagl_egl_onscreen *egl_onscreen = + (struct yagl_egl_onscreen*)sfc->dpy->backend; + + egl_onscreen->gles_driver->Finish(); osfc->ws_sfc->base.set_dirty(&osfc->ws_sfc->base); @@ -131,10 +139,10 @@ static void yagl_egl_onscreen_surface_wait_gl(struct yagl_eglb_surface *sfc) { struct yagl_egl_onscreen_surface *osfc = (struct yagl_egl_onscreen_surface*)sfc; + struct yagl_egl_onscreen *egl_onscreen = + (struct yagl_egl_onscreen*)sfc->dpy->backend; - /* - * M.b. glFinish here ? - */ + egl_onscreen->gles_driver->Finish(); osfc->ws_sfc->base.set_dirty(&osfc->ws_sfc->base); }