<font face="'courier new', monospace">Hi Alexandros,<br><br></font><span style="font-family:'courier new',monospace">Looks good overall.</span><div>
<font face="'courier new', monospace"><br>But there's one detail I'd prefer see done differently: it's better not to introduce this reverse/cyclic dependency from glproc to glws. glproc should be self-sufficient, and the code organized in the following layers:<br>
<br> (e)glimports // type definitions<br> |<br> V<br> glproc // dynamic binding of the entrypoints<br> |</font><div><font face="'courier new', monospace"> V<br> glws // window system abstraction<br>
|</font></div><div><font face="'courier new', monospace"> V</font></div><div><font face="'courier new', monospace"> (e)glretrace // actual application<br>
<br>The <a href="https://github.com/apitrace/apitrace/tree/glproc-cleanup">https://github.com/apitrace/apitrace/tree/glproc-cleanup</a> takes some of your changes but obverses the above scheme. There's more stuff I wanna do in glproc, but it's a good step. I've already tested it on Linux/MacOSX/Windows, so if it doesn't regress Android for you I'll merge it.<br>
<br><br></font></div><div><font face="'courier new', monospace">Jose</font><br style="font-family:'courier new',monospace"><font face="'courier new', monospace"><br>
</font><br>On Thu, Dec 1, 2011 at 4:52 PM, Alexandros Frantzis <<a href="mailto:alexandros.frantzis@linaro.org" target="_blank">alexandros.frantzis@linaro.org</a>> wrote:<br>> Hi all,<br>><br>> in the spirit of what was previously discussed, I am working on a branch<br>
> that implements a scheme allowing the retracers to avoid explicitly<br>> linking with libGL:<br>><br>> <a href="http://git.linaro.org/gitweb?p=people/afrantzis/apitrace.git;a=shortlog;h=refs/heads/retrace-no-link-gl-wip" target="_blank">http://git.linaro.org/gitweb?p=people/afrantzis/apitrace.git;a=shortlog;h=refs/heads/retrace-no-link-gl-wip</a><br>
><br>> This patchset first adds a glws::getProcAddress() function that<br>> implements the logic to get a GL/EGL/... function pointer, by first<br>> trying the system mechanism for getting symbol addresses (dlsym etc),<br>
> and then by using the *GetProcAddress() functions. The implementation<br>> for each system is based on the snippets in *trace.py. The code retains<br>> the approach of first searching in the already linked libraries and<br>
> then, if needed, trying to dlopen() the right GL library. For the<br>> EGL/X11 case, the right library is selected based on the current<br>> context/profile. I have added sample implementations for Cocoa and<br>
> Win32, too, but as I don't have access to such systems, these two are<br>> completely untested.<br>><br>> The patchset also changes the way glproc.hpp is produced for retracing.<br>> In particular, it emits __* dispatchers for *all* processed functions,<br>
> and uses the glws::getProcAddress() function to get the address of both<br>> "public" and "private" symbols. Due to the way glws::getProcAddress()<br>> works, the "private" vs "public" distinction does not make much sense.<br>
><br>> Finally, the patchset ensures that eglretrace doesn't explicitly link<br>> with libGL, and that any needed libraries are indeed linked with (i.e.<br>> marked as NEEDED in the SO) even when none of their symbols are<br>
> explicitly used. This is important primarily for libEGL at the moment.<br>> Of course, if we choose to do so, we can handle libEGL in the same way<br>> that we handle libGL, i.e., not require explicit linking.<br>
><br>> Note that, besides a small fix for proper compilation, the need for<br>> different state dumping mechanisms for GLX/GL vs EGL/GL* is not<br>> addressed at all by this patchset.<br>><br>> Thanks,<br>
> Alexandros<br>> _______________________________________________<br>> apitrace mailing list<br>> <a href="mailto:apitrace@lists.freedesktop.org" target="_blank">apitrace@lists.freedesktop.org</a><br>> <a href="http://lists.freedesktop.org/mailman/listinfo/apitrace" target="_blank">http://lists.freedesktop.org/mailman/listinfo/apitrace</a><br>
</div></div>