blob: 135c69eea2c06ccb2d9e2c1444d2388cd2ca65c5 [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.
9xglEnumerateLayer can be called to list the available layer libraries. xglGetProcAddr i
10used 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:
15layer/basic_plugin.c - simple example
16<build dir>/layer/generic_layer.c - auto generated example wrapping all XGL entrypoints
17
18Using Layers::
19Build XGL loader and i965 icd driver using normal steps (cmake and make)
20Place libXGLLayer<name>.so in the same directory as your XGL test or app:
21 cp build/layer/libXGLLayerBasic.so build/tests
22
23Specify which Layers to activate by using xglCreateDevice XGL_LAYER_CREATE_INFO struct or
24environment variable LIBXGL_LAYERS_LIB
25 export LIBXGL_LAYERS_LIB=libXGLLayerBasic.so
26 cd build/tests; ./xglinfo
27
28
29Status:
30Current Features:
31-scanning of available Layers during xglInitAndEnumerateGpus
32-xglEnumerateLayers and xglGetProcAddr supported APIs in xgl.h, ICD loader and i965 driver
33-multiple layers in a hierarchy supported
34-layer enumeration works
35-layers activated per gpu and per icd driver: separate dispatch table and layer library
36 list in loader for each gpu or icd driver
37-activation via xglCreateDevice extension struct in CreateInfo or via env var
38 (LIBXGL_LAYER_LIBS)
39-layer libraries can be LD_PRELOADed
40
41Current known issues:
42-memory leak of gpu wrapped objects
43-layer libraries don't support multiple dispatch tables for multi-gpus
44-layers with extension APIs not yet tested or supported
45-layer libraries not yet include loader init functionality for full LD_PRELOAD of
46 entire API including xglInitAndEnumerate
47-no support for apps registering layers, must be discovered via initial scan
48-no support for Loader discovering from layer and driver which layers support which
49 gpus/drivers: any layer can be use any gpu right now
50-xglEnumerateLayers doesn't qualify Layers based on gpu, but enumerates all that were scanned
51