blob: 039fe0e1fe038c6fd05ecb7f8c85c6fa5c3cf5ce [file] [log] [blame] [view]
Jon Ashburn183dfd02014-10-22 18:13:16 -06001Layer Description and Status
210/22/2014
3
4Overview:
5Layer libraries can be written to intercept or hook XGL entrypoints for various
6debug and validation purpose. One or more XGL entrypoints can be defined in your Layer
7library. Undefined entrypoints in the Layer library will be passed to the next Layer which
8may be the driver. Multiple layer libraries can be chained (actually a hierarchy) together.
Tobin Ehlis475bebe2014-10-23 08:44:44 -06009xglEnumerateLayer can be called to list the available layer libraries. xglGetProcAddr is
Jon Ashburn183dfd02014-10-22 18:13:16 -060010used internally by the Layers and ICD Loader to initialize dispatch tables. Layers are
11activated at xglCreateDevice time. xglCreateDevice createInfo struct is extended to allow
12a list of layers to be activated. Layer libraries can alternatively be LD_PRELOADed.
13
14Layer library example code:
Tobin Ehlis475bebe2014-10-23 08:44:44 -060015layer/basic_plugin.c - simple example
16<build dir>/layer/generic_layer.c - auto generated example wrapping all XGL entrypoints
17<build dir>/layer/api_dump.c - print out API calls along with parameter values
18<build dir>/layer/object_track.c - Print object CREATE/USE/DESTROY stats
Jon Ashburn183dfd02014-10-22 18:13:16 -060019
20Using Layers::
Tobin Ehlis475bebe2014-10-23 08:44:44 -060021Build XGL loader and i965 icd driver using normal steps (cmake and make)
Jon Ashburn183dfd02014-10-22 18:13:16 -060022Place libXGLLayer<name>.so in the same directory as your XGL test or app:
Jon Ashburnb4d00532014-10-22 21:15:26 -060023 cp build/layer/libXGLLayerBasic.so build/layer/libXGLLayerGeneric.so build/tests
Jon Ashburn183dfd02014-10-22 18:13:16 -060024
25Specify which Layers to activate by using xglCreateDevice XGL_LAYER_CREATE_INFO struct or
26environment variable LIBXGL_LAYERS_LIB
Jon Ashburnb4d00532014-10-22 21:15:26 -060027 export LIBXGL_LAYERS_LIB=libXGLLayerBasic.so:LibXGLLayerGeneric.so
Jon Ashburn183dfd02014-10-22 18:13:16 -060028 cd build/tests; ./xglinfo
29
30
31Status:
32Current Features:
33-scanning of available Layers during xglInitAndEnumerateGpus
34-xglEnumerateLayers and xglGetProcAddr supported APIs in xgl.h, ICD loader and i965 driver
35-multiple layers in a hierarchy supported
36-layer enumeration works
Tobin Ehlis475bebe2014-10-23 08:44:44 -060037-layers activated per gpu and per icd driver: separate dispatch table and layer library
Jon Ashburn183dfd02014-10-22 18:13:16 -060038 list in loader for each gpu or icd driver
39-activation via xglCreateDevice extension struct in CreateInfo or via env var
40 (LIBXGL_LAYER_LIBS)
41-layer libraries can be LD_PRELOADed
42
43Current known issues:
Jon Ashburn183dfd02014-10-22 18:13:16 -060044-layer libraries don't support multiple dispatch tables for multi-gpus
Tobin Ehlis475bebe2014-10-23 08:44:44 -060045-layers with extension APIs not yet tested or supported
46-layer libraries not yet include loader init functionality for full LD_PRELOAD of
Jon Ashburn183dfd02014-10-22 18:13:16 -060047 entire API including xglInitAndEnumerate
48-no support for apps registering layers, must be discovered via initial scan
49-no support for Loader discovering from layer and driver which layers support which
50 gpus/drivers: any layer can be use any gpu right now
51-xglEnumerateLayers doesn't qualify Layers based on gpu, but enumerates all that were scanned
52