mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
glsyncmeta: don't glFinish() everytime a sync point is set
At minimum, we only need to glFlush() if we are in a shared GL context environment. Move the glFinish() to when the actual wait is requested which may be never. Improves the throughput on older GL systems without GL3/GLES3 and/or fence sync objects.
This commit is contained in:
parent
99f5ac40db
commit
08e20ff131
1 changed files with 5 additions and 8 deletions
|
@ -53,16 +53,11 @@ _default_set_sync_gl (GstGLSyncMeta * sync_meta, GstGLContext * context)
|
|||
}
|
||||
sync_meta->data =
|
||||
(gpointer) gl->FenceSync (GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
GST_LOG ("setting sync object %p", sync_meta->data);
|
||||
}
|
||||
|
||||
if (gst_gl_context_is_shared (context))
|
||||
/* if we only have a single context, the wait will flush for us */
|
||||
gl->Flush ();
|
||||
GST_LOG ("setting sync object %p", sync_meta->data);
|
||||
} else {
|
||||
/* XXX: this a little over the top if the CPU is never going to
|
||||
* access the data, however this is the legacy path, so... */
|
||||
gl->Finish ();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -89,6 +84,8 @@ _default_wait_cpu_gl (GstGLSyncMeta * sync_meta, GstGLContext * context)
|
|||
gl->ClientWaitSync ((GLsync) sync_meta->data,
|
||||
GL_SYNC_FLUSH_COMMANDS_BIT, 1000000000 /* 1s */ );
|
||||
} while (res == GL_TIMEOUT_EXPIRED);
|
||||
} else {
|
||||
gl->Finish ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue