tree: dd957f8647ce1ebfc3174f2a4aa6776e56c2f6d8 [path history] [tgz]
  1. CMakeLists.txt
  2. loader.c
  3. loader.h
  4. README.md
loader/README.md

Loader Description

Overview

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.

Environment Variables

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

Interface to driver (ICD)

  • xglInitAndEnumerateGpus exported
  • xglGetProcAddr exported and returns valid function pointers for all the XGL API entrypoints
  • all objects created by ICD can be cast to (XGL_LAYER_DISPATCH_TABLE **) where the loader will replace the first entry with a pointer to the dispatch table which is owned by the loader. This implies two things for ICD drivers:
    1. the ICD must return a pointer for the opaque object handle
    2. this pointer points to a structure with the first entry being a pointer.
  • the ICD may or may not implement a dispatch table
  • ICD entrypoints can be named anything including the offcial xgl name such as xglCreateDevice(). However, beware of inter posing by dynamic OS library loaders if the offical names are used. On Linux, if offical names are used, the ICD library must be linked with -Bsymbolic