The Loader implements the main XGL library: libXGL.so on Linux. It handles layer management and driver management. Loader driver management includes finding driver librairies and loading them. Aditionally, the loader dispatches the API calls to the correct driver based on the GPU selected by the app. The loader fully supports multi-gpu operation.
Loader layer management includes finding layer libraries and activating them as requested. Loader correctly sets up layer and its own dispatch tables to support multiple layers activated. Each active layer can intercept a subset of the full API entrypoints. A layer which doesn't intercept a given entrypoint will be skipped for that entrypoint. The loader supports layers that operate on multiple GPUs.
LIBXGL_DRIVERS_PATH directory for loader to search for ICD driver libraries to open LIBXGL_LAYERS_PATH directory for loader to search for layer libraries that may get activated and used at xglCreateDevice() time. LIBXGL_LAYER_NAMES colon separate list of layer names to be activated. Example, LIBXGL_LAYER_NAMES=MemTracker:DrawState