Mir

Code review comment for lp:~kdub/mir/gl-program-creation-factory

Revision history for this message
Kevin DuBois (kdub) wrote :

> >> 557 + /*
> >> 558 + * We need to serialize renderer creation because some GL calls used
> >> 559 + * during renderer construction that create unique resource ids
> >> 560 + * (e.g. glCreateProgram) are not thread-safe when the threads are
> >> 561 + * have the same or shared EGL contexts.
> >> 562 + */
>
> Can you explain the synchronization requirements a little here? I got a little
> confused...it seems like this isn't sufficient.
>
> If this can be called from multiple threads then something has to ensure the
> eglMakeCurrent is called from the right threads (and held for the duration of
> GL usage), right? So if something is doing this then the lock guard is not
> necessary, if nothing else is handling it then its not quite enough....

I would agree that our handling of the context doesn't really model the requirements of using gl contexts and could be improved. (but I'm not looking to improve that in this MP) I'm trying to preserve the guards that are in place so android can make a shader program in addition to the default compositor.

I suppose this guard is fulfilling:
http://www.khronos.org/opengles/sdk/docs/man/xhtml/glCreateShader.xml
"Applications are responsible for providing the synchronization across API calls when objects are accessed from different execution threads."

« Back to merge proposal