fix "traceGpuCompletion" debug feature

eglCreateSyncKHR requires a call to glFlush which we were not doing.
fixed by moving the code above eglSwapBuffers(), which both
fixes the problem and gives us a slightly better idea of when
the GPU is done drawing.

Change-Id: Ic826ef1fe25a6247742c3d49d0cb69f4031e3593
This commit is contained in:
Mathias Agopian 2013-04-16 16:39:46 -07:00
parent 2f67faeb80
commit ed6d08b70d
1 changed files with 8 additions and 13 deletions

View File

@ -960,6 +960,13 @@ EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface draw)
egl_surface_t const * const s = get_surface(draw);
if (CC_UNLIKELY(dp->traceGpuCompletion)) {
EGLSyncKHR sync = eglCreateSyncKHR(dpy, EGL_SYNC_FENCE_KHR, NULL);
if (sync != EGL_NO_SYNC_KHR) {
FrameCompletionThread::queueSync(sync);
}
}
if (CC_UNLIKELY(dp->finishOnSwap)) {
uint32_t pixel;
egl_context_t * const c = get_context( egl_tls_t::getContext() );
@ -970,19 +977,7 @@ EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface draw)
}
}
EGLBoolean result = s->cnx->egl.eglSwapBuffers(dp->disp.dpy, s->surface);
if (CC_UNLIKELY(dp->traceGpuCompletion)) {
EGLSyncKHR sync = EGL_NO_SYNC_KHR;
{
sync = eglCreateSyncKHR(dpy, EGL_SYNC_FENCE_KHR, NULL);
}
if (sync != EGL_NO_SYNC_KHR) {
FrameCompletionThread::queueSync(sync);
}
}
return result;
return s->cnx->egl.eglSwapBuffers(dp->disp.dpy, s->surface);
}
EGLBoolean eglCopyBuffers( EGLDisplay dpy, EGLSurface surface,