Jon Ashburn | 8c51936 | 2015-01-06 10:33:36 -0700 | [diff] [blame] | 1 | # Loader Description |
| 2 | |
| 3 | ## Overview |
| 4 | The Loader implements the main XGL library: libXGL.so on Linux. It handles |
| 5 | layer management and driver management. Loader driver management includes |
| 6 | finding driver librairies and loading them. Aditionally, the loader dispatches |
| 7 | the API calls to the correct driver based on the GPU selected by the app. The |
| 8 | loader fully supports multi-gpu operation. |
| 9 | |
| 10 | Loader layer management includes finding layer libraries and activating them |
| 11 | as requested. Loader correctly sets up layer and its own dispatch tables to |
| 12 | support multiple layers activated. Each active layer can intercept a subset of |
| 13 | the full API entrypoints. A layer which doesn't intercept a given entrypoint |
| 14 | will be skipped for that entrypoint. The loader supports layers that operate |
| 15 | on multiple GPUs. |
| 16 | |
| 17 | ## Environment Variables |
| 18 | LIBXGL\_DRIVERS\_PATH directory for loader to search for ICD driver libraries to open |
Courtney Goeltzenleuchter | c507e3d | 2015-01-07 09:24:45 -0700 | [diff] [blame] | 19 | |
| 20 | LIBXGL\_LAYERS\_PATH directory for loader to search for layer libraries that may get activated and used at xglCreateDevice() time. |
| 21 | |
| 22 | LIBXGL\_LAYER\_NAMES colon separate list of layer names to be activated. Example, |
Jon Ashburn | 8c51936 | 2015-01-06 10:33:36 -0700 | [diff] [blame] | 23 | LIBXGL\_LAYER\_NAMES=MemTracker:DrawState |
| 24 | |
| 25 | ## Interface to driver (ICD) |
| 26 | - xglInitAndEnumerateGpus exported |
| 27 | - xglGetProcAddr exported and returns valid function pointers for all the XGL API entrypoints |
| 28 | - all objects created by ICD can be cast to (XGL\_LAYER\_DISPATCH\_TABLE **) |
| 29 | where the loader will replace the first entry with a pointer to the dispatch table which is |
Courtney Goeltzenleuchter | c507e3d | 2015-01-07 09:24:45 -0700 | [diff] [blame] | 30 | owned by the loader. This implies two things for ICD drivers: |
| 31 | 1. the ICD must return a pointer for the opaque object handle |
| 32 | 2. this pointer points to a structure with the first entry being a pointer. |
| 33 | - the ICD may or may not implement a dispatch table |
| 34 | - ICD entrypoints can be named anything including the offcial xgl name such as xglCreateDevice(). However, beware of inter |
| 35 | posing by dynamic OS library loaders if the offical names are used. On Linux, |
GregF | a2ff5b3 | 2015-01-20 11:51:00 -0700 | [diff] [blame] | 36 | if offical names are used, the ICD library must be linked with -Bsymbolic |
Courtney Goeltzenleuchter | c507e3d | 2015-01-07 09:24:45 -0700 | [diff] [blame] | 37 | |