<br><br><div class="gmail_quote">On Fri, Dec 10, 2010 at 3:13 PM, Chia-I Wu <span dir="ltr">&lt;<a href="mailto:olvaffe@gmail.com">olvaffe@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
With OpenGL ES coming to desktop, the way the current context/dispatch<br>
is stored, together with the way libGLES*.so is created, causes<br>
several issues[1].  The root of these issues is that the symbols<br>
defined in libGL.so and in libGLES*.so overlaps, and an application<br>
might link to both of them indirectly!<br>
<br>
In light of GLX_EXT_create_context_es2_profile, the simplest solution<br>
would be to stop distributing libGLES*.so.  Applications will always<br>
link to libGL.so.  Those that use GLX can then call glXGetProcAddress<br>
to get the addresses of OpenGL ES 2.0 functions.  But those that use<br>
EGL will be in trouble.  eglGetProcAddress is defined not to return<br>
the addresses of non-extension functions.<br></blockquote><div><br>I don&#39;t think it is a good solution to stop distributing libGLES*.so, because in embeded/mobile world, a lot of applications have dependency on libGLES*.so instead of libGL.so. <br>
 </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
If libGL.so and libGLES*.so both have to be distributed, then the<br>
question becomes how to handle symbols that overlaps gracefully.<br>
<br>
Accessing global variables such as _glapi_Context and _glapi_Dispatch<br>
will fail.  Say libGL.so and libGLES*.so both has a copy of<br>
_glapi_Context.  There is no guarantee that GET_CURRENT_CONTEXT will<br>
return the same context set by _glapi_set_context.<br>
<br>
Calling global functions will work as long as they are identical in<br>
both libGL.so and libGLES*.so.  This means both libraries must agree<br>
on the order of slots in the dispatch table.  And the problem with two<br>
copies of global _glapi_Dispatch also needs to be solved.<br>
<br>
One solution for these issues is to move _glapi_Context,<br>
_glapi_Dispatch, and _glapi_* functions to libglapi.so.  libGL.so and<br>
libGLES*.so will both link to libglapi.so.  All the libraries must be<br>
distributed together, as they must agree on the dispatch table used.<br>
This change should not break the ABI for existing DRI drivers.<br>
<br>
Another option is make _glapi_Context and _glapi_Dispatch local.<br>
libGL.so, libGLES*.so, and every DRI driver will get a renamed local<br>
copy of _glapi_Context and _glapi_Dispatch.  To not break the ABI for<br>
old DRI drivers, libGL.so and libGLES*.so will still export<br>
_glapi_Dispatch and _glapi_Context.  But same as the first solution,<br>
there must be a big dispatch table that libGL.so and libGLES*.so can<br>
agree on. </blockquote><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
There should be other options, but these are all I have now.  Any<br>
thought?<br>
<br>
[1] <a href="https://bugs.freedesktop.org/show_bug.cgi?id=32285" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=32285</a><br>
<font color="#888888"><br>
--<br>
olv@LunarG.com<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></blockquote></div><br>