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